On Thu, Jun 25, 2026 at 07:29:07PM +0100, Gavin Smith wrote:
> On Tue, Jun 23, 2026 at 11:51:20PM +0200, Patrice Dumas wrote:
> > >     /* Interface similar to the Perl modules interface for Texinfo 
> > > parsing,
> > >        higher-level interface for document structure and transformations,
> > >        and interface similar to the Perl modules interface for conversion 
> > > */
> > > 
> > > I don't get from this a clear idea of what this file is for.
> > 
> > The texinfo.c file is not at all related to convertion to Texinfo
> > (conversion to Texinfo is in main/convert_to_texinfo.c).  It is for code
> > never called from XS, better out of texi2any.c and not rightly into more
> > specific files such as converter.c or structuring.c.  Maybe the
> > organization could be ameliorated for this file, and the name could be
> > different.
> 
> It appears that convert/texinfo.c functions are only used in texi2any.c.
> What about renaming the file "texi2any_auxiliary.c" (or similar)?

Some of these functions are also used in the SWIG interface, in
tta/swig/texinfo.i.  At least txi_destroy_document,
txi_output_parser_error_messages, txi_complete_document,
txi_output_document_error_messages and txi_general_output_strings_setup.

> The names of all the functions in convert/texinfo.c have a "txi_" prefix,
> as if they were part of some public API, but they are not, as far as I
> am aware.

At some point, I thought about having this file as the only interface
between the libraries and texi2any.c.  Later on I gave up.  I left the
txi_ prefix to avoid the possibility for name clash as there are
wrappers in the file.

> The file is described as an "interface" but does not replicate
> an interface that exists in Perl code.

It is an interface between the C libraries and the program or the SWIG
interface.

> Would there be anything wrong with removing the txi_ name prefixes and/or
> folding some of this code back into texi2any.c?

With the caveat that functions relevant for the SWIG interface should
remain in a file common with texi2any.

-- 
Pat

Reply via email to