[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/XS/main/get_perl_info.c, tp/Texinfo/
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/XS/main/get_perl_info.c, tp/Texinfo/XS/main/utils.h: remove more code related to sorting in C based on sortable entries from perl, get_sv_sortable_entries, KEY_ALPHA, SORTABLE_ENTRY and INDEX_SORTABLE_ENTRIES. |
Date: |
Sun, 05 Nov 2023 16:22:00 -0500 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new 21c4e42f9c * tp/Texinfo/XS/main/get_perl_info.c,
tp/Texinfo/XS/main/utils.h: remove more code related to sorting in C based on
sortable entries from perl, get_sv_sortable_entries, KEY_ALPHA, SORTABLE_ENTRY
and INDEX_SORTABLE_ENTRIES.
21c4e42f9c is described below
commit 21c4e42f9cbe691c1b872b1c3c6800d1383445f4
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Nov 5 22:21:50 2023 +0100
* tp/Texinfo/XS/main/get_perl_info.c, tp/Texinfo/XS/main/utils.h:
remove more code related to sorting in C based on sortable entries
from perl, get_sv_sortable_entries, KEY_ALPHA, SORTABLE_ENTRY and
INDEX_SORTABLE_ENTRIES.
---
ChangeLog | 7 ++
tp/Texinfo/XS/main/get_perl_info.c | 211 -------------------------------------
tp/Texinfo/XS/main/get_perl_info.h | 4 -
tp/Texinfo/XS/main/utils.h | 21 ----
4 files changed, 7 insertions(+), 236 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 271da2eb82..a77e645408 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-11-05 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/main/get_perl_info.c, tp/Texinfo/XS/main/utils.h:
+ remove more code related to sorting in C based on sortable entries
+ from perl, get_sv_sortable_entries, KEY_ALPHA, SORTABLE_ENTRY and
+ INDEX_SORTABLE_ENTRIES.
+
2023-11-05 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/HTML.pm (_sort_index_entries),
diff --git a/tp/Texinfo/XS/main/get_perl_info.c
b/tp/Texinfo/XS/main/get_perl_info.c
index 58ae178bde..a5723060a5 100644
--- a/tp/Texinfo/XS/main/get_perl_info.c
+++ b/tp/Texinfo/XS/main/get_perl_info.c
@@ -1212,217 +1212,6 @@ set_output_converter_sv (SV *sv_in, char *warn_string)
return converter;
}
-INDEX_SORTABLE_ENTRIES **
-get_sv_sortable_entries (SV *sortable_entries_in)
-{
- AV *av_in;
- SSize_t av_number;
- SSize_t j;
- INDEX_SORTABLE_ENTRIES **result;
-
- dTHX;
-
- if (!SvOK (sortable_entries_in))
- return 0;
-
- av_in = (AV *)SvRV (sortable_entries_in);
-
- av_number = av_top_index (av_in) +1;
-
- if (!av_number)
- return 0;
-
- result = (INDEX_SORTABLE_ENTRIES **)
- malloc ((av_number +1) * sizeof (INDEX_SORTABLE_ENTRIES *));
-
- result[av_number] = 0;
-
- for (j = 0; j < av_number; j++)
- {
- int i;
- char *idx_name = 0;
- SSize_t index_entries_nr;
- AV *index_encoded_sortable_entries_av;
- SV **idx_name_sv;
- SV **encoded_sortable_entries_sv;
- AV *av;
-
- SV **index_encoded_sortable_entries_sv = av_fetch (av_in, j, 0);
- if (!index_encoded_sortable_entries_sv)
- {
- char *msg;
- xasprintf (&msg,
- "get_sv_sortable_entries: %d: no index sortable entries\n", j);
- fatal (msg);
- }
-
- index_encoded_sortable_entries_av
- = (AV *)SvRV (*index_encoded_sortable_entries_sv);
-
- idx_name_sv = av_fetch (index_encoded_sortable_entries_av, 0, 0);
- if (!idx_name_sv)
- {
- char *msg;
- xasprintf (&msg,
- "get_sv_sortable_entries: %d: no index name\n", j);
- fatal (msg);
- }
- idx_name = (char *) SvPVbyte_nolen (*idx_name_sv);
-
- encoded_sortable_entries_sv
- = av_fetch (index_encoded_sortable_entries_av, 1, 0);
- if (!encoded_sortable_entries_sv)
- {
- char *msg;
- xasprintf (&msg,
- "get_sv_sortable_entries: %d: %s: no sortable entries\n",
- j, idx_name);
- fatal (msg);
- }
-
- result[j] = (INDEX_SORTABLE_ENTRIES *)
- malloc (sizeof (INDEX_SORTABLE_ENTRIES));
- result[j]->name = strdup (idx_name);
-
- av = (AV *)SvRV (*encoded_sortable_entries_sv);
-
- index_entries_nr = av_top_index (av) +1;
- result[j]->number = index_entries_nr;
- result[j]->sortable_entries = (SORTABLE_ENTRY *)
- malloc (index_entries_nr * sizeof (SORTABLE_ENTRY));
- for (i = 0; i < index_entries_nr; i++)
- {
- SV** sortable_entry_sv = av_fetch (av, i, 0);
- if (sortable_entry_sv)
- {
- SV **number_sv;
- SV **index_name_sv;
- SV **keys_sv;
- SV **entry_keys_sv;
- SORTABLE_ENTRY * sortable_entry =
&result[j]->sortable_entries[i];
-
- HV *hv_sortable_entry = (HV *)SvRV (*sortable_entry_sv);
-
- number_sv = hv_fetch (hv_sortable_entry, "number",
- strlen ("number"), 0);
- if (number_sv)
- {
- sortable_entry->number = SvIV (*number_sv);
- }
- else
- {
- char *msg;
- xasprintf (&msg,
- "get_sv_sortable_entries: %s: %d: no number\n", idx_name, i);
- fatal (msg);
- }
-
- index_name_sv = hv_fetch (hv_sortable_entry, "index_name",
- strlen ("index_name"), 0);
- if (index_name_sv)
- {
- char *index_name_tmp
- = (char *) SvPVbyte_nolen (*index_name_sv);
- sortable_entry->index_name = strdup (index_name_tmp);
- }
- else
- {
- char *msg;
- xasprintf (&msg,
- "get_sv_sortable_entries: %s: %d: no index_name\n", idx_name, i);
- fatal (msg);
- }
-
- keys_sv = hv_fetch (hv_sortable_entry, "keys",
- strlen ("keys"), 0);
- entry_keys_sv = hv_fetch (hv_sortable_entry, "entry_keys",
- strlen ("entry_keys"), 0);
-
- if (keys_sv && entry_keys_sv)
- {
- int k;
- SSize_t keys_nr;
- SSize_t entry_keys_nr;
- AV *keys_av = (AV *) SvRV (*keys_sv);
- AV *entry_keys_av = (AV *) SvRV (*entry_keys_sv);
- keys_nr = av_top_index (keys_av) +1;
- entry_keys_nr = av_top_index (entry_keys_av) +1;
- if (keys_nr != entry_keys_nr)
- {
- char *msg;
- xasprintf (&msg,
- "get_sv_sortable_entries: %s: %d: keys_nr %d != entry_keys_nr
%d\n",
- idx_name, i, keys_nr, entry_keys_nr);
- fatal (msg);
- }
-
- sortable_entry->keys_number = keys_nr;
- sortable_entry->keys
- = (KEY_ALPHA *) malloc (keys_nr * sizeof (KEY_ALPHA));
- sortable_entry->entry_keys
- = (char **) malloc (keys_nr * sizeof (char*));
-
- for (k = 0; k < keys_nr; k++)
- {
- SV** key_sv = av_fetch (keys_av, k, 0);
- SV** entry_key_sv = av_fetch (entry_keys_av, k, 0);
- if (key_sv)
- {
- KEY_ALPHA *key_alpha = &sortable_entry->keys[k];
- AV *key_alpha_av = (AV *) SvRV (*key_sv);
- SV **key_string_sv = av_fetch (key_alpha_av, 0, 0);
- SV **key_alpha_sv = av_fetch (key_alpha_av, 1, 0);
- char *key_string_tmp;
- if (!key_string_sv || !key_alpha_sv)
- {
- char *msg;
- xasprintf (&msg,
- "get_sv_sortable_entries: %s: %d: %d: no key string
or alpha\n",
- idx_name, i, k);
- fatal (msg);
- }
- key_string_tmp = (char *) SvPVbyte_nolen
(*key_string_sv);
- key_alpha->key = strdup (key_string_tmp);
- key_alpha->alpha = SvIV (*key_alpha_sv);
- }
- else
- {
- char *msg;
- xasprintf (&msg,
- "get_sv_sortable_entries: %s: %d: %d: no key\n",
- idx_name, i, k);
- fatal (msg);
- }
-
- if (entry_key_sv)
- {
- char *entry_key_tmp
- = (char *) SvPVbyte_nolen (*entry_key_sv);
- sortable_entry->entry_keys[k] = strdup
(entry_key_tmp);
- }
- else
- {
- char *msg;
- xasprintf (&msg,
- "get_sv_sortable_entries: %s: %d: %d: no
entry_key\n",
- idx_name, i, k);
- fatal (msg);
- }
- }
- }
- else
- {
- char *msg;
- xasprintf (&msg,
- "get_sv_sortable_entries: %s: %d: no keys\n", idx_name, i);
- fatal (msg);
- }
- }
- }
- }
- return result;
-}
-
void
get_sv_index_entries_sorted_by_letter (CONVERTER *converter,
SV *index_entries_sorted_by_letter)
diff --git a/tp/Texinfo/XS/main/get_perl_info.h
b/tp/Texinfo/XS/main/get_perl_info.h
index 2840d12a43..8bdea1065b 100644
--- a/tp/Texinfo/XS/main/get_perl_info.h
+++ b/tp/Texinfo/XS/main/get_perl_info.h
@@ -6,8 +6,6 @@
#include "tree_types.h"
#include "converter_types.h"
#include "convert_to_text.h"
-/* for INDEX_SORTABLE_ENTRIES */
-#include "utils.h"
DOCUMENT *get_sv_tree_document (SV *tree_in, char *warn_string);
DOCUMENT *get_sv_document_document (SV *document_in, char *warn_string);
@@ -32,8 +30,6 @@ int html_converter_initialize_sv (SV *sv_in, SV
*default_formatting_references,
CONVERTER *set_output_converter_sv (SV *sv_in, char *warn_string);
CONVERTER *get_sv_converter (SV *sv_in, char *warn_string);
-INDEX_SORTABLE_ENTRIES **get_sv_sortable_entries (SV *sortable_entries_in);
-
void get_sv_index_entries_sorted_by_letter (CONVERTER *converter,
SV
*index_entries_sorted_by_letter);
#endif
diff --git a/tp/Texinfo/XS/main/utils.h b/tp/Texinfo/XS/main/utils.h
index 8167d06c98..9fae830ae4 100644
--- a/tp/Texinfo/XS/main/utils.h
+++ b/tp/Texinfo/XS/main/utils.h
@@ -193,27 +193,6 @@ typedef struct FILE_SOURCE_INFO_LIST {
FILE_SOURCE_INFO *list;
} FILE_SOURCE_INFO_LIST;
-/* used in get_perl_info and indices_in_conversion, in unfinished code */
-/* TODO remove? */
-typedef struct KEY_ALPHA {
- char *key;
- int alpha;
-} KEY_ALPHA;
-
-typedef struct SORTABLE_ENTRY {
- char *index_name;
- size_t keys_number;
- KEY_ALPHA *keys;
- char **entry_keys;
- int number;
-} SORTABLE_ENTRY;
-
-typedef struct INDEX_SORTABLE_ENTRIES {
- char *name;
- size_t number;
- SORTABLE_ENTRY *sortable_entries;
-} INDEX_SORTABLE_ENTRIES;
-
#define HTML_ARGUMENTS_FORMATTED_FORMAT_TYPE \
html_aft_type(none) \
html_aft_type(normal) \
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/XS/main/get_perl_info.c, tp/Texinfo/XS/main/utils.h: remove more code related to sorting in C based on sortable entries from perl, get_sv_sortable_entries, KEY_ALPHA, SORTABLE_ENTRY and INDEX_SORTABLE_ENTRIES.,
Patrice Dumas <=