[tex-k] kpathsearch and Octave

Olaf Weber olaf@infovore.xs4all.nl
25 Oct 2002 20:37:54 +0200


John W Eaton writes:

> First, Octave is interactive, and users may change the value of the
> path used for searching for functions at any time, so I need to be
> able to clear the directory cache and start fresh.  The patch below
> adds a new function for this purpose.

Do you really need to clear the directory cache for this?  I _think_
just picking a different search path should already work, but I may be
completely off.  (Unless the resulting "memory leak" is your concern.)

> Second, when a user changes the search path, Octave needs to expand it
> again, prepending, appending, or inserting the default path, and this
> needs to be done in a way that can avoid memory leaks.  The way
> kpse_expand_default is currently written, it is impossible to know
> whether it is safe to free the expansion that it returns.  The patch
> below causes kpse_expand_default to always return newly allocated
> storage, which the caller is then responsible for deleting.

That sounds reasonable.

> Finally, there seems to be no independent distribution of the library
> outside the teTeX sources (please correct me if I'm wrong about that).

Outside of the web2c sources, to be precise.  I do recognize this as a
problem, but properly disentangling libkpathsea from web2c will take
some effort.  In particular, there are parts of the build system that
I'm looking at and would like to change/clean up.  I am also not happy
with the library interface when looked at as a shared library
interface, and I'm profoundly unhappy with the headers that have to be
installed.

At present, my first priority is to help Thomas get the next teTeX
out.  More ambitious stuff comes after that.

-- 
Olaf Weber

               (This space left blank for technical reasons.)