[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Mon, 20 May 2024 08:27:54 -0400 (EDT) |
branch: master
commit 6645796a3e68d19c39ec77c9289c7edb83d73499
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon May 20 14:27:50 2024 +0200
* tp/Texinfo/XS/parsetexi/conf.c: add parser_ in the name of all the
functions in conf.c that are part of the parser public API.
---
ChangeLog | 5 +++++
tp/Texinfo/XS/main/translations.c | 16 ++++++++--------
tp/Texinfo/XS/parsetexi/Parsetexi.pm | 26 +++++++++++++-------------
tp/Texinfo/XS/parsetexi/Parsetexi.xs | 33 ++++++++++++++++-----------------
tp/Texinfo/XS/parsetexi/api.c | 4 ++--
tp/Texinfo/XS/parsetexi/conf.c | 34 +++++++++++++++++-----------------
tp/Texinfo/XS/parsetexi/conf.h | 34 +++++++++++++++++-----------------
7 files changed, 78 insertions(+), 74 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 949a8c0839..b80d437dc1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-05-20 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/parsetexi/conf.c: add parser_ in the name of all the
+ functions in conf.c that are part of the parser public API.
+
2024-05-20 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/parsetexi/conf.h (PARSER_CONF): rename CONF as
diff --git a/tp/Texinfo/XS/main/translations.c
b/tp/Texinfo/XS/main/translations.c
index db4e825e6a..fbf9c7cc01 100644
--- a/tp/Texinfo/XS/main/translations.c
+++ b/tp/Texinfo/XS/main/translations.c
@@ -469,15 +469,15 @@ replace_convert_substrings (char *translated_string,
if (debug_level > 0)
parser_debug_level = debug_level - 1;
- previous_debug_level = conf_set_DEBUG (parser_debug_level);
+ previous_debug_level = parser_conf_set_DEBUG (parser_debug_level);
/*
accept @txiinternalvalue as a valid Texinfo command, used to mark
location in tree of substituted brace enclosed strings.
*/
- conf_set_accept_internalvalue (1);
- previous_no_index = conf_set_NO_INDEX (1);
- previous_no_user_commands = conf_set_NO_USER_COMMANDS (1);
+ parser_conf_set_accept_internalvalue (1);
+ previous_no_index = parser_conf_set_NO_INDEX (1);
+ previous_no_user_commands = parser_conf_set_NO_USER_COMMANDS (1);
document_descriptor = parse_string (texinfo_line, 1);
@@ -497,10 +497,10 @@ replace_convert_substrings (char *translated_string,
}
clear_document_parser_errors (document_descriptor);
- conf_set_accept_internalvalue (0);
- conf_set_NO_INDEX (previous_no_index);
- conf_set_NO_USER_COMMANDS (previous_no_user_commands);
- conf_set_DEBUG (previous_debug_level);
+ parser_conf_set_accept_internalvalue (0);
+ parser_conf_set_NO_INDEX (previous_no_index);
+ parser_conf_set_NO_USER_COMMANDS (previous_no_user_commands);
+ parser_conf_set_DEBUG (previous_debug_level);
if (replaced_substrings)
{
diff --git a/tp/Texinfo/XS/parsetexi/Parsetexi.pm
b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
index 1d9a500793..54c8260913 100644
--- a/tp/Texinfo/XS/parsetexi/Parsetexi.pm
+++ b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
@@ -92,7 +92,7 @@ sub parser (;$)
$debug = $parser->{'DEBUG'} if ($parser->{'DEBUG'});
reset_parser($debug);
# (re)set debug in any case, assuming that undef DEBUG is no debug
- conf_set_DEBUG($debug);
+ parser_conf_set_DEBUG($debug);
if (defined($conf)) {
foreach my $key (keys(%$conf)) {
@@ -104,37 +104,37 @@ sub parser (;$)
parser_store_EXPANDED_FORMATS($conf->{'EXPANDED_FORMATS'});
} elsif ($key eq 'documentlanguage') {
if (defined ($conf->{$key})) {
- conf_set_documentlanguage($conf->{$key});
+ parser_conf_set_documentlanguage($conf->{$key});
}
} elsif ($key eq 'FORMAT_MENU') {
if ($conf->{$key} and $conf->{$key} eq 'menu') {
- conf_set_show_menu(1);
+ parser_conf_set_show_menu(1);
} else {
- conf_set_show_menu(0);
+ parser_conf_set_show_menu(0);
}
} elsif ($key eq 'IGNORE_SPACE_AFTER_BRACED_COMMAND_NAME') {
- conf_set_IGNORE_SPACE_AFTER_BRACED_COMMAND_NAME($conf->{$key});
+ parser_conf_set_IGNORE_SPACE_AFTER_BRACED_COMMAND_NAME($conf->{$key});
} elsif ($key eq 'CPP_LINE_DIRECTIVES') {
- conf_set_CPP_LINE_DIRECTIVES($conf->{$key});
+ parser_conf_set_CPP_LINE_DIRECTIVES($conf->{$key});
} elsif ($key eq 'MAX_MACRO_CALL_NESTING') {
- conf_set_MAX_MACRO_CALL_NESTING($conf->{$key});
+ parser_conf_set_MAX_MACRO_CALL_NESTING($conf->{$key});
} elsif ($key eq 'NO_INDEX') {
- conf_set_NO_INDEX($conf->{$key});
+ parser_conf_set_NO_INDEX($conf->{$key});
} elsif ($key eq 'NO_USER_COMMANDS') {
- conf_set_NO_USER_COMMANDS($conf->{$key});
+ parser_conf_set_NO_USER_COMMANDS($conf->{$key});
} elsif ($key eq 'DOC_ENCODING_FOR_INPUT_FILE_NAME') {
- conf_set_DOC_ENCODING_FOR_INPUT_FILE_NAME($conf->{$key});
+ parser_conf_set_DOC_ENCODING_FOR_INPUT_FILE_NAME($conf->{$key});
} elsif ($key eq 'INPUT_FILE_NAME_ENCODING') {
if (defined($conf->{$key})) {
- conf_set_INPUT_FILE_NAME_ENCODING($conf->{$key});
+ parser_conf_set_INPUT_FILE_NAME_ENCODING($conf->{$key});
}
} elsif ($key eq 'LOCALE_ENCODING') {
if (defined($conf->{$key})) {
- conf_set_LOCALE_ENCODING($conf->{$key});
+ parser_conf_set_LOCALE_ENCODING($conf->{$key});
}
} elsif ($key eq 'accept_internalvalue') {
if ($conf->{$key}) {
- conf_set_accept_internalvalue(1);
+ parser_conf_set_accept_internalvalue(1);
}
} elsif ($key eq 'registrar' or $key eq 'COMMAND_LINE_ENCODING'
or $key eq 'DEBUG') {
diff --git a/tp/Texinfo/XS/parsetexi/Parsetexi.xs
b/tp/Texinfo/XS/parsetexi/Parsetexi.xs
index 3fffb9a7fd..175b91e041 100644
--- a/tp/Texinfo/XS/parsetexi/Parsetexi.xs
+++ b/tp/Texinfo/XS/parsetexi/Parsetexi.xs
@@ -130,7 +130,7 @@ parser_store_values (SV *values)
void
parser_store_INCLUDE_DIRECTORIES (SV *directories)
CODE:
- conf_clear_INCLUDE_DIRECTORIES ();
+ parser_conf_clear_INCLUDE_DIRECTORIES ();
if (SvOK (directories))
{
SSize_t i;
@@ -146,7 +146,7 @@ parser_store_INCLUDE_DIRECTORIES (SV *directories)
are already byte strings (or ascii). The encoding was detected
as COMMAND_LINE_ENCODING, but it is not used in the XS parser. */
char *directory = SvPVbyte_nolen (*directory_sv);
- conf_add_include_directory (directory);
+ parser_conf_add_include_directory (directory);
}
}
}
@@ -154,7 +154,7 @@ parser_store_INCLUDE_DIRECTORIES (SV *directories)
void
parser_store_EXPANDED_FORMATS (SV *expanded_formats)
CODE:
- conf_clear_expanded_formats ();
+ parser_conf_clear_expanded_formats ();
if (SvOK (expanded_formats))
{
SSize_t i;
@@ -167,48 +167,47 @@ parser_store_EXPANDED_FORMATS (SV *expanded_formats)
if (format_sv && SvOK (*format_sv))
{
char *format = SvPVutf8_nolen (*format_sv);
- conf_add_expanded_format (format);
+ parser_conf_add_expanded_format (format);
}
}
}
void
-conf_set_show_menu (int i)
+parser_conf_set_show_menu (int i)
void
-conf_set_CPP_LINE_DIRECTIVES (int i)
+parser_conf_set_CPP_LINE_DIRECTIVES (int i)
void
-conf_set_IGNORE_SPACE_AFTER_BRACED_COMMAND_NAME (int i)
+parser_conf_set_IGNORE_SPACE_AFTER_BRACED_COMMAND_NAME (int i)
void
-conf_set_MAX_MACRO_CALL_NESTING (int i)
+parser_conf_set_MAX_MACRO_CALL_NESTING (int i)
int
-conf_set_NO_INDEX (int i)
+parser_conf_set_NO_INDEX (int i)
int
-conf_set_NO_USER_COMMANDS (int i)
+parser_conf_set_NO_USER_COMMANDS (int i)
void
-conf_set_DOC_ENCODING_FOR_INPUT_FILE_NAME (int i)
+parser_conf_set_DOC_ENCODING_FOR_INPUT_FILE_NAME (int i)
void
-conf_set_INPUT_FILE_NAME_ENCODING (value)
+parser_conf_set_INPUT_FILE_NAME_ENCODING (value)
char *value = (char *)SvPVutf8_nolen ($arg);
void
-conf_set_LOCALE_ENCODING (value)
+parser_conf_set_LOCALE_ENCODING (value)
char *value = (char *)SvPVutf8_nolen ($arg);
void
-conf_set_documentlanguage (value)
+parser_conf_set_documentlanguage (value)
char *value = (char *)SvPVutf8_nolen ($arg);
int
-conf_set_DEBUG (int i)
+parser_conf_set_DEBUG (int i)
void
-conf_set_accept_internalvalue (int value)
-
+parser_conf_set_accept_internalvalue (int value)
diff --git a/tp/Texinfo/XS/parsetexi/api.c b/tp/Texinfo/XS/parsetexi/api.c
index 24016976d0..7515c1c06d 100644
--- a/tp/Texinfo/XS/parsetexi/api.c
+++ b/tp/Texinfo/XS/parsetexi/api.c
@@ -104,7 +104,7 @@ reset_parser (int local_debug_output)
fprintf (stderr,
"!!!!!!!!!!!!!!!! RESETTING THE PARSER !!!!!!!!!!!!!!!!!!!!!\n");
- reset_conf ();
+ reset_parser_conf ();
}
/* Determine directory path based on file name.
@@ -151,7 +151,7 @@ parse_file (const char *filename, const char
*input_file_name,
{
char saved = *p;
*p = '\0';
- conf_add_include_directory (filename);
+ parser_conf_add_include_directory (filename);
*p = saved;
}
diff --git a/tp/Texinfo/XS/parsetexi/conf.c b/tp/Texinfo/XS/parsetexi/conf.c
index 7836088b67..5722d818b4 100644
--- a/tp/Texinfo/XS/parsetexi/conf.c
+++ b/tp/Texinfo/XS/parsetexi/conf.c
@@ -25,31 +25,31 @@
PARSER_CONF parser_conf;
void
-conf_set_show_menu (int i)
+parser_conf_set_show_menu (int i)
{
parser_conf.show_menu = i;
}
void
-conf_set_CPP_LINE_DIRECTIVES (int i)
+parser_conf_set_CPP_LINE_DIRECTIVES (int i)
{
parser_conf.cpp_line_directives = i;
}
void
-conf_set_IGNORE_SPACE_AFTER_BRACED_COMMAND_NAME (int i)
+parser_conf_set_IGNORE_SPACE_AFTER_BRACED_COMMAND_NAME (int i)
{
parser_conf.ignore_space_after_braced_command_name = i;
}
void
-conf_set_MAX_MACRO_CALL_NESTING (int i)
+parser_conf_set_MAX_MACRO_CALL_NESTING (int i)
{
parser_conf.max_macro_call_nesting = i;
}
int
-conf_set_NO_INDEX (int i)
+parser_conf_set_NO_INDEX (int i)
{
int previous = parser_conf.no_index;
parser_conf.no_index = i;
@@ -57,7 +57,7 @@ conf_set_NO_INDEX (int i)
}
int
-conf_set_NO_USER_COMMANDS (int i)
+parser_conf_set_NO_USER_COMMANDS (int i)
{
int previous = parser_conf.no_user_commands;
parser_conf.no_user_commands = i;
@@ -65,7 +65,7 @@ conf_set_NO_USER_COMMANDS (int i)
}
int
-conf_set_DEBUG (int i)
+parser_conf_set_DEBUG (int i)
{
int previous = parser_conf.debug;
parser_conf.debug = i;
@@ -73,31 +73,31 @@ conf_set_DEBUG (int i)
}
void
-conf_clear_INCLUDE_DIRECTORIES (void)
+parser_conf_clear_INCLUDE_DIRECTORIES (void)
{
clear_strings_list (&parser_conf.include_directories);
}
void
-conf_add_include_directory (const char *filename)
+parser_conf_add_include_directory (const char *filename)
{
add_include_directory (filename, &parser_conf.include_directories);
}
void
-conf_clear_expanded_formats (void)
+parser_conf_clear_expanded_formats (void)
{
clear_expanded_formats (parser_conf.expanded_formats);
}
void
-conf_add_expanded_format (const char *format)
+parser_conf_add_expanded_format (const char *format)
{
add_expanded_format (parser_conf.expanded_formats, format);
}
void
-conf_set_documentlanguage (const char *value)
+parser_conf_set_documentlanguage (const char *value)
{
free (parser_conf.documentlanguage);
parser_conf.documentlanguage = value ? strdup (value) : 0;
@@ -105,33 +105,33 @@ conf_set_documentlanguage (const char *value)
}
void
-conf_set_DOC_ENCODING_FOR_INPUT_FILE_NAME (int i)
+parser_conf_set_DOC_ENCODING_FOR_INPUT_FILE_NAME (int i)
{
parser_conf.doc_encoding_for_input_file_name = i;
}
void
-conf_set_INPUT_FILE_NAME_ENCODING (const char *value)
+parser_conf_set_INPUT_FILE_NAME_ENCODING (const char *value)
{
free (parser_conf.input_file_name_encoding);
parser_conf.input_file_name_encoding = value ? strdup (value) : 0;
}
void
-conf_set_LOCALE_ENCODING (const char *value)
+parser_conf_set_LOCALE_ENCODING (const char *value)
{
free (parser_conf.locale_encoding);
parser_conf.locale_encoding = value ? strdup (value) : 0;
}
void
-conf_set_accept_internalvalue (int value)
+parser_conf_set_accept_internalvalue (int value)
{
parser_conf.accept_internalvalue = value;
}
void
-reset_conf (void)
+reset_parser_conf (void)
{
wipe_values (&parser_conf.values);
clear_strings_list (&parser_conf.include_directories);
diff --git a/tp/Texinfo/XS/parsetexi/conf.h b/tp/Texinfo/XS/parsetexi/conf.h
index b5daa03a45..dc12ced08c 100644
--- a/tp/Texinfo/XS/parsetexi/conf.h
+++ b/tp/Texinfo/XS/parsetexi/conf.h
@@ -42,23 +42,23 @@ typedef struct CONF {
extern PARSER_CONF parser_conf;
/* part of public API */
-void conf_set_show_menu (int i);
-void conf_set_CPP_LINE_DIRECTIVES (int i);
-int conf_set_DEBUG (int i);
-void conf_set_IGNORE_SPACE_AFTER_BRACED_COMMAND_NAME (int i);
-void conf_set_MAX_MACRO_CALL_NESTING (int i);
-int conf_set_NO_INDEX (int i);
-int conf_set_NO_USER_COMMANDS (int i);
-void conf_clear_INCLUDE_DIRECTORIES (void);
-void conf_add_include_directory (const char *filename);
-void conf_clear_expanded_formats (void);
-void conf_add_expanded_format (const char *format);
-void conf_set_documentlanguage (const char *value);
-void conf_set_DOC_ENCODING_FOR_INPUT_FILE_NAME (int i);
-void conf_set_INPUT_FILE_NAME_ENCODING (const char *value);
-void conf_set_LOCALE_ENCODING (const char *value);
-void conf_set_accept_internalvalue (int value);
+void parser_conf_set_show_menu (int i);
+void parser_conf_set_CPP_LINE_DIRECTIVES (int i);
+int parser_conf_set_DEBUG (int i);
+void parser_conf_set_IGNORE_SPACE_AFTER_BRACED_COMMAND_NAME (int i);
+void parser_conf_set_MAX_MACRO_CALL_NESTING (int i);
+int parser_conf_set_NO_INDEX (int i);
+int parser_conf_set_NO_USER_COMMANDS (int i);
+void parser_conf_clear_INCLUDE_DIRECTORIES (void);
+void parser_conf_add_include_directory (const char *filename);
+void parser_conf_clear_expanded_formats (void);
+void parser_conf_add_expanded_format (const char *format);
+void parser_conf_set_documentlanguage (const char *value);
+void parser_conf_set_DOC_ENCODING_FOR_INPUT_FILE_NAME (int i);
+void parser_conf_set_INPUT_FILE_NAME_ENCODING (const char *value);
+void parser_conf_set_LOCALE_ENCODING (const char *value);
+void parser_conf_set_accept_internalvalue (int value);
-void reset_conf (void);
+void reset_parser_conf (void);
#endif