> I would suggest to add it as a new function in the external
> c-code so it will be easy to compare with the old one and use the old
> one if something breaks. The external c-code is a bit cumbersome to
> work with due to the C90 standard and memory allocation etc., but it
> can be done.
I have a version of xperm.c which compiles fine on current standard
compilers (e.g. clang on macOS) without requiring the C90 oddities.
Available in the cadabra2 repository at
http://github.com/kpeeters/cadabra2
in the 'core/modules/xperm_new.cc' file (and associated .hh). You need
to compile it with a C++ compiler because I used some C++ things
internally, but you can still call the functions from C. Have not yet
tried to use it from within xAct though.
However, I agree with Thomas that it is a bit cumbersome and could do
with more documentation. It _might_ be a better long term solution to
write a clean version from scratch, using the C++ standard library
throughout for memory management, though you don't have to explain
to me how that would eat your time...
Cheers,
Kasper