gnuastro-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-devel] [task #14300] Option management using new root data str


From: Mohammad Akhlaghi
Subject: [gnuastro-devel] [task #14300] Option management using new root data structure.
Date: Sun, 8 Jan 2017 02:05:27 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0

Update of task #14300 (project gnuastro):

        Percent Complete:                      0% => 10%                    

    _______________________________________________________

Follow-up Comment #3:

This was a very intriguing thought, and since I am going through the programs
for using `gal_data_t', I thought it would be very useful if this system is
adopted also, so the two jobs can be done in one round of learning/remembering
how the programs work!

After thinking about it, I came up with a better solution that I have just
pushed <https://gitlab.com/makhlaghi/gnuastro/commit/9bb47f370ae> to my
development branch. I think I came up with a better solution that what was
suggested in previous comments on this task. They needed to define a new array
in parallel to `argp_option' and its management could its self cause
bugs/management-nightmares.

So now, we edit the definition of `argp_option' from `argp.h' during
bootstrapping. An AWK script was included in `bootstrap.conf' to add the new
`void *value', and `void *type' elements to this structure in `argp.h' after
all the source files are imported from Gnulib. As a test, I implemented it in
the Table program, by setting values for these elements in `args.h' and it is
compiling with no errors.

So the new data structure only came in handy by giving us a standard way to
work with types/void-*, but nevertheless was still instrumental in the
inception of this approach.  

Also, defining a flag for every option as suggested bellow would make the
flags too much and hard to manage. The library will just read the values,
store them in the appropriate type, and check if all values are given, Then
the program's `ui.c' will go over them and put them into the respective
element of the main program's data structure. During this phase, it can also
check the validity of their values (for example if the number must be
positive, or less than 1 and so on).

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/task/?14300>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]