gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 2a60869c: All programs: ui.c function name cor


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 2a60869c: All programs: ui.c function name correctly describes purpose
Date: Sat, 23 Dec 2023 17:16:53 -0500 (EST)

branch: master
commit 2a60869c1a8690a9f4f91b66d120b6f22812a974
Author: Faezeh Bidjarchian <fbidjarchian@gmail.com>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    All programs: ui.c function name correctly describes purpose
    
    Until now, the 'ui_read_check_only_options' function of all the programs
    included a '_read_' component. However, in this function, we only check the
    option values, we don't read them. So, this function name does not
    accurately reflect its purpose and this word is redundant.
    
    With this commit, the word '_read_' component has been removed from the
    function name to make it more descriptive and accurate.
---
 bin/TEMPLATE/ui.c    | 11 +++++------
 bin/arithmetic/ui.c  |  8 +++++---
 bin/buildprog/ui.c   | 11 +++++------
 bin/convertt/ui.c    | 11 +++++------
 bin/convolve/ui.c    |  8 +++++---
 bin/cosmiccal/ui.c   | 11 +++++------
 bin/crop/ui.c        | 11 +++++------
 bin/fits/ui.c        | 11 +++++------
 bin/match/ui.c       | 11 +++++------
 bin/mkcatalog/ui.c   | 11 +++++------
 bin/mkprof/ui.c      | 11 +++++------
 bin/noisechisel/ui.c | 11 +++++------
 bin/query/ui.c       | 11 +++++------
 bin/segment/ui.c     | 11 +++++------
 bin/statistics/ui.c  | 15 +++++++--------
 bin/table/ui.c       | 11 +++++------
 16 files changed, 82 insertions(+), 92 deletions(-)

diff --git a/bin/TEMPLATE/ui.c b/bin/TEMPLATE/ui.c
index 371c076c..0f5847b0 100644
--- a/bin/TEMPLATE/ui.c
+++ b/bin/TEMPLATE/ui.c
@@ -202,10 +202,10 @@ parse_opt(int key, char *arg, struct argp_state *state)
 /**************************************************************/
 /***************       Sanity Check         *******************/
 /**************************************************************/
-/* Read and check ONLY the options. When arguments are involved, do the
-   check in 'ui_check_options_and_arguments'. */
+/* Check ONLY the options. When arguments are involved, do the check
+   in 'ui_check_options_and_arguments'. */
 static void
-ui_read_check_only_options(struct TEMPLATEparams *p)
+ui_check_only_options(struct TEMPLATEparams *p)
 {
 
 }
@@ -315,9 +315,8 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
TEMPLATEparams *p)
   gal_options_read_config_set(&p->cp);
 
 
-  /* Read the options into the program's structure, and check them and
-     their relations prior to printing. */
-  ui_read_check_only_options(p);
+  /* Sanity check only on options. */
+  ui_check_only_options(p);
 
 
   /* Print the option values if asked. Note that this needs to be done
diff --git a/bin/arithmetic/ui.c b/bin/arithmetic/ui.c
index 2aca747c..13ea0aa1 100644
--- a/bin/arithmetic/ui.c
+++ b/bin/arithmetic/ui.c
@@ -229,8 +229,10 @@ parse_opt(int key, char *arg, struct argp_state *state)
 /**************************************************************/
 /***************       Sanity Check         *******************/
 /**************************************************************/
+/* Check ONLY the options. When arguments are involved, do the check
+   in 'ui_check_options_and_arguments'. */
 static void
-ui_read_check_only_options(struct arithmeticparams *p)
+ui_check_only_options(struct arithmeticparams *p)
 {
   if(p->wcsfile && strcmp(p->wcsfile,"none"))
     {
@@ -250,7 +252,7 @@ ui_read_check_only_options(struct arithmeticparams *p)
 
 
 /* Sanity check on options AND arguments. If only option values are to be
-   checked, use 'ui_read_check_only_options'. */
+   checked, use 'ui_check_only_options'. */
 static void
 ui_check_options_and_arguments(struct arithmeticparams *p)
 {
@@ -483,7 +485,7 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
arithmeticparams *p)
 
 
   /* Sanity check only on options. */
-  ui_read_check_only_options(p);
+  ui_check_only_options(p);
 
 
   /* Check that the options and arguments fit well with each other. Note
diff --git a/bin/buildprog/ui.c b/bin/buildprog/ui.c
index 5a56f734..a909e9a6 100644
--- a/bin/buildprog/ui.c
+++ b/bin/buildprog/ui.c
@@ -220,10 +220,10 @@ parse_opt(int key, char *arg, struct argp_state *state)
 /**************************************************************/
 /***************       Sanity Check         *******************/
 /**************************************************************/
-/* Read and check ONLY the options. When arguments are involved, do the
-   check in 'ui_check_options_and_arguments'. */
+/* Check ONLY the options. When arguments are involved, do the check
+   in 'ui_check_options_and_arguments'. */
 static void
-ui_read_check_only_options(struct buildprogparams *p)
+ui_check_only_options(struct buildprogparams *p)
 {
   size_t len;
 
@@ -354,9 +354,8 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
buildprogparams *p)
   gal_options_read_config_set(&p->cp);
 
 
-  /* Read the options into the program's structure, and check them and
-     their relations prior to printing. */
-  ui_read_check_only_options(p);
+  /* Sanity check only on options. */
+  ui_check_only_options(p);
 
 
   /* Print the option values if asked. Note that this needs to be done
diff --git a/bin/convertt/ui.c b/bin/convertt/ui.c
index 441add87..2d0edab8 100644
--- a/bin/convertt/ui.c
+++ b/bin/convertt/ui.c
@@ -468,10 +468,10 @@ ui_show_fonts(struct converttparams *p)
 
 
 
-/* Read and check ONLY the options. When arguments are involved, do the
-   check in 'ui_check_options_and_arguments'. */
+/* Check ONLY the options. When arguments are involved, do the check
+   in 'ui_check_options_and_arguments'. */
 static void
-ui_read_check_only_options(struct converttparams *p)
+ui_check_only_options(struct converttparams *p)
 {
   gal_data_t *cond;
 
@@ -1781,9 +1781,8 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
converttparams *p)
   gal_options_read_config_set(&p->cp);
 
 
-  /* Read the options into the program's structure, and check them and
-     their relations prior to printing. */
-  ui_read_check_only_options(p);
+  /* Sanity check only on options. */
+  ui_check_only_options(p);
 
 
   /* Print the option values if asked. Note that this needs to be done
diff --git a/bin/convolve/ui.c b/bin/convolve/ui.c
index fe6d4716..fca4c8b3 100644
--- a/bin/convolve/ui.c
+++ b/bin/convolve/ui.c
@@ -207,8 +207,10 @@ parse_opt(int key, char *arg, struct argp_state *state)
 /**************************************************************/
 /***************       Sanity Check         *******************/
 /**************************************************************/
+/* Check ONLY the options. When arguments are involved, do the check
+   in 'ui_check_options_and_arguments'. */
 static void
-ui_read_check_only_options(struct convolveparams *p)
+ui_check_only_options(struct convolveparams *p)
 {
   struct gal_options_common_params *cp=&p->cp;
 
@@ -744,8 +746,8 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
convolveparams *p)
   gal_options_read_config_set(&p->cp);
 
 
-  /* Do a sanity check only on options. */
-  ui_read_check_only_options(p);
+  /* Sanity check only on options. */
+  ui_check_only_options(p);
 
 
   /* Print the option values if asked. Note that this needs to be done
diff --git a/bin/cosmiccal/ui.c b/bin/cosmiccal/ui.c
index 40be5d6f..5041290d 100644
--- a/bin/cosmiccal/ui.c
+++ b/bin/cosmiccal/ui.c
@@ -395,10 +395,10 @@ ui_parse_obsline(struct argp_option *option, char *arg,
 /**************************************************************/
 /***************       Sanity Check         *******************/
 /**************************************************************/
-/* Read and check ONLY the options. When arguments are involved, do the
-   check in 'ui_check_options_and_arguments'. */
+/* Check ONLY the options. When arguments are involved, do the check
+   in 'ui_check_options_and_arguments'. */
 static void
-ui_read_check_only_options(struct cosmiccalparams *p)
+ui_check_only_options(struct cosmiccalparams *p)
 {
   int hasobsline=p->obsline!=NULL;
   int hasredshift=!isnan(p->redshift);
@@ -656,9 +656,8 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
cosmiccalparams *p)
   gal_options_read_config_set(&p->cp);
 
 
-  /* Read the options into the program's structure, and check them and
-     their relations prior to printing. */
-  ui_read_check_only_options(p);
+  /* Sanity check only on options. */
+  ui_check_only_options(p);
 
 
   /* Print the option values if asked. Note that this needs to be done
diff --git a/bin/crop/ui.c b/bin/crop/ui.c
index 98fbc0d5..6bd55bd5 100644
--- a/bin/crop/ui.c
+++ b/bin/crop/ui.c
@@ -270,10 +270,10 @@ ui_parse_coordinate_mode(struct argp_option *option, char 
*arg,
 /**************************************************************/
 /***************       Sanity Check         *******************/
 /**************************************************************/
-/* Read and check ONLY the options. When arguments are involved, do the
-   check in 'ui_check_options_and_arguments'. */
+/* Check ONLY the options. When arguments are involved, do the check
+   in 'ui_check_options_and_arguments'. */
 static void
-ui_read_check_only_options(struct cropparams *p)
+ui_check_only_options(struct cropparams *p)
 {
   double *darray;
   int i, checksum;
@@ -1210,9 +1210,8 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
cropparams *p)
   gal_options_read_config_set(&p->cp);
 
 
-  /* Read the options into the program's structure, and check them and
-     their relations prior to printing. */
-  ui_read_check_only_options(p);
+  /* Sanity check only on options. */
+  ui_check_only_options(p);
 
 
   /* Print the option values if asked. Note that this needs to be done
diff --git a/bin/fits/ui.c b/bin/fits/ui.c
index ae26e547..3e9c999e 100644
--- a/bin/fits/ui.c
+++ b/bin/fits/ui.c
@@ -530,10 +530,10 @@ ui_read_check_mode_extension(struct fitsparams *p)
 
 
 
-/* Read and check ONLY the options. When arguments are involved, do the
-   check in 'ui_check_options_and_arguments'. */
+/* Check ONLY the options. When arguments are involved, do the check
+   in 'ui_check_options_and_arguments'. */
 static void
-ui_read_check_only_options(struct fitsparams *p)
+ui_check_only_options(struct fitsparams *p)
 {
   /* Check the given optinos and set the operating mode accordingly. */
   ui_read_check_mode_keyword(p);
@@ -819,9 +819,8 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
fitsparams *p)
   gal_options_read_config_set(&p->cp);
 
 
-  /* Read the options into the program's structure, and check them and
-     their relations prior to printing. */
-  ui_read_check_only_options(p);
+  /* Sanity check only on options. */
+  ui_check_only_options(p);
 
 
   /* Print the option values if asked. Note that this needs to be done
diff --git a/bin/match/ui.c b/bin/match/ui.c
index 1e127a81..05340c81 100644
--- a/bin/match/ui.c
+++ b/bin/match/ui.c
@@ -213,10 +213,10 @@ parse_opt(int key, char *arg, struct argp_state *state)
 /**************************************************************/
 /***************       Sanity Check         *******************/
 /**************************************************************/
-/* Read and check ONLY the options. When arguments are involved, do the
-   check in 'ui_check_options_and_arguments'. */
+/* Check ONLY the options. When arguments are involved, do the check
+   in 'ui_check_options_and_arguments'. */
 static void
-ui_read_check_only_options(struct matchparams *p)
+ui_check_only_options(struct matchparams *p)
 {
   /* k-d tree specific sanity checks. */
   if(p->kdtree)
@@ -1198,9 +1198,8 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
matchparams *p)
   gal_options_read_config_set(&p->cp);
 
 
-  /* Read the options into the program's structure, and check them and
-     their relations prior to printing. */
-  ui_read_check_only_options(p);
+  /* Sanity check only on options. */
+  ui_check_only_options(p);
 
 
   /* Print the option values if asked. Note that this needs to be done
diff --git a/bin/mkcatalog/ui.c b/bin/mkcatalog/ui.c
index db4c8511..d8e8acdf 100644
--- a/bin/mkcatalog/ui.c
+++ b/bin/mkcatalog/ui.c
@@ -359,10 +359,10 @@ ui_check_upperlimit(struct argp_option *option, char *arg,
 /**************************************************************/
 /***************       Sanity Check         *******************/
 /**************************************************************/
-/* Read and check ONLY the options. When arguments are involved, do the
-   check in 'ui_check_options_and_arguments'. */
+/* Check ONLY the options. When arguments are involved, do the check
+   in 'ui_check_options_and_arguments'. */
 static void
-ui_read_check_only_options(struct mkcatalogparams *p)
+ui_check_only_options(struct mkcatalogparams *p)
 {
   float tmp;
   double *darr;
@@ -1925,9 +1925,8 @@ ui_read_check_inputs_setup(int argc, char *argv[],
   gal_options_read_config_set(&p->cp);
 
 
-  /* Read the options into the program's structure, and check them and
-     their relations prior to printing. */
-  ui_read_check_only_options(p);
+  /* Sanity check only on options. */
+  ui_check_only_options(p);
 
 
   /* Print the option values if asked. Note that this needs to be done
diff --git a/bin/mkprof/ui.c b/bin/mkprof/ui.c
index e58e097f..dda32371 100644
--- a/bin/mkprof/ui.c
+++ b/bin/mkprof/ui.c
@@ -520,10 +520,10 @@ ui_parse_coordinate_mode(struct argp_option *option, char 
*arg,
 /**************************************************************/
 /***************       Sanity Check         *******************/
 /**************************************************************/
-/* Read and check ONLY the options. When arguments are involved, do the
+/* Check ONLY the options. When arguments are involved, do the
    check in 'ui_check_options_and_arguments'. */
 static void
-ui_read_check_only_options(struct mkprofparams *p)
+ui_check_only_options(struct mkprofparams *p)
 {
   size_t i;
 
@@ -598,7 +598,7 @@ ui_read_check_only_options(struct mkprofparams *p)
 
 
 /* Sanity check on options AND arguments. If only option values are to be
-   checked, use 'ui_read_check_only_options'. */
+   checked, use 'ui_check_only_options'. */
 static void
 ui_check_options_and_arguments(struct mkprofparams *p)
 {
@@ -2163,9 +2163,8 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
mkprofparams *p)
   gal_options_read_config_set(&p->cp);
 
 
-  /* Read the options into the program's structure, and check them and
-     their relations prior to printing. */
-  ui_read_check_only_options(p);
+  /* Sanity check only on options. */
+  ui_check_only_options(p);
 
 
   /* Print the option values if asked. Note that this needs to be done
diff --git a/bin/noisechisel/ui.c b/bin/noisechisel/ui.c
index c7e175bf..01da7438 100644
--- a/bin/noisechisel/ui.c
+++ b/bin/noisechisel/ui.c
@@ -219,10 +219,10 @@ parse_opt(int key, char *arg, struct argp_state *state)
 /**************************************************************/
 /***************       Sanity Check         *******************/
 /**************************************************************/
-/* Read and check ONLY the options. When arguments are involved, do the
-   check in 'ui_check_options_and_arguments'. */
+/* Check ONLY the options. When arguments are involved, do the check
+   in 'ui_check_options_and_arguments'. */
 static void
-ui_read_check_only_options(struct noisechiselparams *p)
+ui_check_only_options(struct noisechiselparams *p)
 {
   /* If the convolved option is given, then the convolved HDU is also
      mandatory. */
@@ -758,9 +758,8 @@ ui_read_check_inputs_setup(int argc, char *argv[],
   gal_options_read_config_set(&p->cp);
 
 
-  /* Read the options into the program's structure, and check them and
-     their relations prior to printing. */
-  ui_read_check_only_options(p);
+  /* Sanity check only on options. */
+  ui_check_only_options(p);
 
 
   /* Print the option values if asked. Note that this needs to be done
diff --git a/bin/query/ui.c b/bin/query/ui.c
index d00d43c3..681df80d 100644
--- a/bin/query/ui.c
+++ b/bin/query/ui.c
@@ -260,10 +260,10 @@ ui_strlist_to_str(gal_list_str_t *input)
 /**************************************************************/
 /***************       Sanity Check         *******************/
 /**************************************************************/
-/* Read and check ONLY the options. When arguments are involved, do the
-   check in 'ui_check_options_and_arguments'. */
+/* Check ONLY the options. When arguments are involved, do the check
+   in 'ui_check_options_and_arguments'. */
 static void
-ui_read_check_only_options(struct queryparams *p)
+ui_check_only_options(struct queryparams *p)
 {
   size_t i;
   double *darray;
@@ -563,9 +563,8 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
queryparams *p)
   gal_options_read_config_set(&p->cp);
 
 
-  /* Read the options into the program's structure, and check them and
-     their relations prior to printing. */
-  ui_read_check_only_options(p);
+  /* Sanity check only on options. */
+  ui_check_only_options(p);
 
 
   /* Print the option values if asked. Note that this needs to be done
diff --git a/bin/segment/ui.c b/bin/segment/ui.c
index 64f213ee..c5f1b556 100644
--- a/bin/segment/ui.c
+++ b/bin/segment/ui.c
@@ -225,10 +225,10 @@ parse_opt(int key, char *arg, struct argp_state *state)
 /**************************************************************/
 /***************       Sanity Check         *******************/
 /**************************************************************/
-/* Read and check ONLY the options. When arguments are involved, do the
-   check in 'ui_check_options_and_arguments'. */
+/* Check ONLY the options. When arguments are involved, do the check
+   in 'ui_check_options_and_arguments'. */
 static void
-ui_read_check_only_options(struct segmentparams *p)
+ui_check_only_options(struct segmentparams *p)
 {
   /* If the full area is to be used as a single detection, we can't find
      the S/N value from the un-detected regions, so the user must have
@@ -948,9 +948,8 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
segmentparams *p)
   gal_options_read_config_set(&p->cp);
 
 
-  /* Read the options into the program's structure, and check them and
-     their relations prior to printing. */
-  ui_read_check_only_options(p);
+  /* Sanity check only on options. */
+  ui_check_only_options(p);
 
 
   /* Print the option values if asked. Note that this needs to be done
diff --git a/bin/statistics/ui.c b/bin/statistics/ui.c
index 343a80b3..7dce8312 100644
--- a/bin/statistics/ui.c
+++ b/bin/statistics/ui.c
@@ -385,10 +385,10 @@ ui_read_quantile_range(struct argp_option *option, char 
*arg,
 /**************************************************************/
 /***************       Sanity Check         *******************/
 /**************************************************************/
-/* Read and check ONLY the options. When arguments are involved, do the
-   check in 'ui_check_options_and_arguments'. */
+/* Check ONLY the options. When arguments are involved, do the check
+   in 'ui_check_options_and_arguments'. */
 static void
-ui_read_check_only_options(struct statisticsparams *p)
+ui_check_only_options(struct statisticsparams *p)
 {
   gal_list_i32_t *tmp;
   struct gal_tile_two_layer_params *tl=&p->cp.tl;
@@ -1031,7 +1031,7 @@ ui_preparations_fitestimate(struct statisticsparams *p)
         }
 
       /* Make sure a HDU is specified. We need to do this here (not
-         in 'ui_read_check_only_options') because only here we know
+         in 'ui_check_only_options') because only here we know
          that the user specified a file not a value. */
       if( gal_fits_name_is_fits(p->fitestimate) && p->fitestimatehdu==NULL )
         error(EXIT_FAILURE, 0, "no HDU specified for '%s' (given to "
@@ -1039,7 +1039,7 @@ ui_preparations_fitestimate(struct statisticsparams *p)
               "option to specify the HDU", p->fitestimate);
 
       /* Make sure a column is specified. We need to do this here (not
-         in 'ui_read_check_only_options') because only here we know
+         in 'ui_check_only_options') because only here we know
          that the user specified a file not a value. */
       if( p->fitestimatecol==NULL )
         error(EXIT_FAILURE, 0, "no column specified for '%s' (given to "
@@ -1315,9 +1315,8 @@ ui_read_check_inputs_setup(int argc, char *argv[],
   gal_options_read_config_set(&p->cp);
 
 
-  /* Read the options into the program's structure, and check them and
-     their relations prior to printing. */
-  ui_read_check_only_options(p);
+  /* Sanity check only on options. */
+  ui_check_only_options(p);
 
 
   /* Print the option values if asked. Note that this needs to be done
diff --git a/bin/table/ui.c b/bin/table/ui.c
index e6522d43..06287290 100644
--- a/bin/table/ui.c
+++ b/bin/table/ui.c
@@ -226,10 +226,10 @@ parse_opt(int key, char *arg, struct argp_state *state)
 /**************************************************************/
 /***************       Sanity Check         *******************/
 /**************************************************************/
-/* Read and check ONLY the options. When arguments are involved, do the
-   check in 'ui_check_options_and_arguments'. */
+/* Check ONLY the options. When arguments are involved, do the check
+   in 'ui_check_options_and_arguments'. */
 static void
-ui_read_check_only_options(struct tableparams *p)
+ui_check_only_options(struct tableparams *p)
 {
   size_t i;
   double *darr;
@@ -1456,9 +1456,8 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
tableparams *p)
   gal_options_read_config_set(&p->cp);
 
 
-  /* Read the options into the program's structure, and check them and
-     their relations prior to printing. */
-  ui_read_check_only_options(p);
+  /* Sanity check only on options. */
+  ui_check_only_options(p);
 
 
   /* Print the option values if asked. Note that this needs to be done



reply via email to

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