TREX-CoE / qmckl

Quantum Monte Carlo Kernel Library

Home Page:http://trex-coe.github.io/qmckl/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Non-uniform lists of arguments in the header file

q-posev opened this issue · comments

In the generated qmckl.h header file the lists of arguments follow 3 different patterns (see below). It adds additional complexity to processing the header file by external tools (e.g. SWIG which parses the header file looking for certain patterns in the arguments lists).

Having arguments in one line is also good for grep-ing but might decrease the readability of the header file.

<func_name> (<type1>* <arg1>, ...)

<func_name> (<type1> * <arg1>, ...) (space between pointer and type declaration)

<func_name> (<type1> <arg1>,
             <type2> <arg2>,
                       ...
                      )

With the multiple people who will contribute to the library, it is going to be difficult to impose to put or not a space before the star. Also, putting all arguments on the same line is not good for readability.

I suggest that you write a script that creates from qmckl.h another file in a format easy to grep, and that you use this file for SWIG.

OK, at the moment I use the custom process_header.py script to parse the qmckl.h and generate the SWIG interfaces.