gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master db9f983 065/125: Arithmetic uses new option ma


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master db9f983 065/125: Arithmetic uses new option management, no more mask images
Date: Sun, 23 Apr 2017 22:36:38 -0400 (EDT)

branch: master
commit db9f9832607e3ec54bc4dc2dc24c5254b2b25d74
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    Arithmetic uses new option management, no more mask images
    
    The new option management system is now implemented in Arithmetic's
    `ui.c'. Also, since Arithmetic now has very easy and useful ways to set
    blank pixels, it is no longer necessary to have Mask images as inputs in
    programs. It just makes things more complicated for the users (two extra
    options) and developers. In the other programs also, users can use
    Arithmetic first to mask pixels they don't want to use.
    
    In the process some other minor corrections were made as described below:
    
     - The constant variables in `args.h' (of both Arithmetic and Table) have
       been changed mainly to reflect the same style as functions (where the
       type is on a separate line before the variable name and value).
    
     - All mask image functions in `fits.c' have been corrected.
    
     - The `Mask image' section of the book has been removed and all references
       to it (along with discussions of a mask image) have been corrected.
---
 bin/arithmetic/args.h                     | 215 +++++-----------
 bin/arithmetic/arithmetic.c               |  11 +-
 bin/arithmetic/{cite.h => authors-cite.h} |  30 +--
 bin/arithmetic/main.c                     |   2 +-
 bin/arithmetic/main.h                     |  38 +--
 bin/arithmetic/operands.c                 |  16 +-
 bin/arithmetic/ui.c                       | 404 +++++++++---------------------
 bin/table/args.h                          |  72 +++---
 bin/table/main.h                          |   2 +-
 bin/table/ui.c                            |  57 ++---
 doc/gnuastro.texi                         | 291 ++++++++-------------
 lib/checkset.c                            |  21 +-
 lib/checkset.h                            |   9 +-
 lib/fits.c                                |  48 ++--
 lib/gnuastro/fits.h                       |  10 +-
 lib/options.h                             |  24 +-
 tmpfs-config-make                         |   2 +-
 17 files changed, 424 insertions(+), 828 deletions(-)

diff --git a/bin/arithmetic/args.h b/bin/arithmetic/args.h
index c9bf2a9..73ffb65 100644
--- a/bin/arithmetic/args.h
+++ b/bin/arithmetic/args.h
@@ -23,55 +23,47 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #ifndef ARGS_H
 #define ARGS_H
 
-#include <argp.h>
-
-#include <gnuastro/linkedlist.h>
-
-#include <commonargs.h>
-#include <fixedstringmacros.h>
-
-
-
-
-
 
 
 
 
-
-/**************************************************************/
-/**************        argp.h definitions       ***************/
-/**************************************************************/
+/* Include necessary headers. */
+#define NOT_COMMON_HDU_PARSER 1
+#include <commonopts.h>
+#include <authors-cite.h>
+#include <fixedstringmacros.h>
 
 
 
 /* Definition parameters for the argp: */
-const char *argp_program_version=SPACK_STRING"\n"GAL_STRINGS_COPYRIGHT
-  "\n\nWritten by Mohammad Akhlaghi";
-const char *argp_program_bug_address=PACKAGE_BUGREPORT;
-static char args_doc[] = "ASTRdata or number [ASTRdata] OPERATOR ...";
-
-
-
-
-
-const char doc[] =
-  /* Before the list of options: */
-  GAL_STRINGS_TOP_HELP_INFO
-  SPACK_NAME" will do arithmetic operations on one or multiple images and "
-  "numbers. Simply put, the name of the image along with the arithmetic "
-  "operators and possible numbers are given as arguments. The extensions of "
-  "each input image are expected as options (starting with `hdu') listed "
-  "below. Please note that currently "SPACK_NAME" only supports postfix "
-  "or reverse polish notation. For example to get the result of `5+6', you "
-  "should write `5 6 +', or to get the average of two images, you should "
-  "write `a.fits b.fits + 2 /' (or more simply a.fits b.fits average). "
-  "Please see the manual for more information. "
-  "\n\nThe operators/functions recognized by "SPACK_NAME" are: +, -, *, /, "
-  "abs, pow, sqrt, log, log10, minvalue, maxvalue, min, max, average, median, "
-  "lt, le, gt, ge, eq, ne, and, or, not, isblank. Please run `info gnuastro "
-  "\"Arithmetic operators\"' for detailed information on each operator. Note "
-  "that multiplication should be quoted (like \"*\", or '*') to avoid shell "
+const char *
+argp_program_version = PROGRAM_STRING "\n"
+                       GAL_STRINGS_COPYRIGHT
+                       "\n\nWritten/developed by "PROGRAM_AUTHORS;
+
+const char *
+argp_program_bug_address = PACKAGE_BUGREPORT;
+
+static char
+args_doc[] = "ASTRdata or number [ASTRdata] OPERATOR ...";
+
+const char
+doc[] = GAL_STRINGS_TOP_HELP_INFO PROGRAM_NAME" will do arithmetic "
+  "operations on one or multiple images and numbers. Simply put, the name "
+  "of the image along with the arithmetic operators and possible numbers "
+  "are given as arguments. The extensions of each input image are expected "
+  "as options (starting with `hdu') listed below. Please note that currently "
+  PROGRAM_NAME" only supports postfix or reverse polish notation. For "
+  "example to get the result of `5+6', you should write `5 6 +', or to get "
+  "the average of two images, you should write `a.fits b.fits + 2 /' (or "
+  "more simply a.fits b.fits average). Please see the manual for more "
+  "information. "
+  "\n\nThe operators/functions recognized by "PROGRAM_NAME" are: +, -, *, "
+  "/, abs, pow, sqrt, log, log10, minvalue, maxvalue, min, max, average, "
+  "median, lt, le, gt, ge, eq, ne, and, or, not, isblank, and the full set "
+  "of bitwise operators. Please run `info gnuastro \"Arithmetic "
+  "operators\"' for detailed information on each operator. Note that "
+  "multiplication should be quoted (like \"*\", or '*') to avoid shell "
   "expansion.\n"
   GAL_STRINGS_MORE_HELP_INFO
   /* After the list of options: */
@@ -85,13 +77,16 @@ const char doc[] =
 /* Available letters for short options:
 
    a b c d e f g i j k l m n p r s t u v w x y z
-   A B C E F G H I J L O Q R U W X Y Z
+   A B C E F G H I J L M O Q R T U W X Y Z                */
+enum option_keys_enum
+{
+  /* With short-option version. */
+  ARGS_OPTION_HDU_KEY        = 'h',
 
-   Number keys used: <=500
+  /* Only with long version (start with a value 1000, the rest will be set
+     automatically). */
+};
 
-   Options with keys (second structure element) larger than 500 do not
-   have a short version.
- */
 static struct argp_option options[] =
   {
     {
@@ -101,27 +96,12 @@ static struct argp_option options[] =
     },
     {
       "hdu",
-      'h',
+      ARGS_OPTION_HDU_KEY,
       "STR",
       0,
       "Nth call of this option, used for Nth input FITS.",
-      1
-    },
-    {
-      "mask",
-      'M',
-      "STR",
-      0,
-      "Mask image file name.",
-      1
-    },
-    {
-      "mhdu",
-      'H',
-      "STR",
-      0,
-      "Mask image header name.",
-      1
+      1,
+      NULL, GAL_DATA_TYPE_STRLL
     },
 
 
@@ -132,14 +112,8 @@ static struct argp_option options[] =
       "Output:",
       2
     },
-    {
-      "type",
-      'T',
-      "STR",
-      0,
-      "uchar, short, long, longlong, float, double.",
-      2
-    },
+
+
 
 
     {
@@ -157,16 +131,13 @@ static struct argp_option options[] =
 
 
 /* Parse a single option: */
-static error_t
+error_t
 parse_opt(int key, char *arg, struct argp_state *state)
 {
-  /* Save the arguments structure: */
-  char *tokeephdu;
   struct imgarithparams *p = state->input;
 
-  /* Set the pointer to the common parameters for all programs
-     here: */
-  state->child_inputs[0]=&p->cp;
+  /* Pass `gal_options_common_params' into the child parser.  */
+  state->child_inputs[0] = &p->cp;
 
   /* In case the user incorrectly uses the equal sign (for example
      with a short format or with space in the long format, then `arg`
@@ -180,71 +151,21 @@ parse_opt(int key, char *arg, struct argp_state *state)
                "there should be no space between the option, equal sign "
                "and value");
 
+  /* Set the key to this option. */
   switch(key)
     {
 
-    /* Commandline options don't need to be allocated, since they are
-       already in static memory and their pointers will not
-       change. They also don't need to be freed for the same
-       reason. However, later on, we will also be reading from the
-       configuration files and there, we need to allocate space (and
-       free it later). So to consistently free all the poped strings,
-       we are allocating a copy here too. */
-    case 'h':
-      gal_checkset_allocate_copy(arg, &tokeephdu);
-      gal_linkedlist_add_to_stll(&p->hdus, tokeephdu);
-      break;
-
-    /* Input: */
-    case 'M':
-      gal_checkset_allocate_copy_set(arg, &p->up.maskname,
-                                     &p->up.masknameset);
-      break;
-    case 'H':
-      gal_checkset_allocate_copy_set(arg, &p->up.mhdu, &p->up.mhduset);
-      break;
-
-
-    /* Output */
-    case 'T':
-      gal_checkset_known_types(arg, &p->outtype, NULL, 0);
-      p->up.typeset=1;
-      break;
-
-    /* Operating modes: */
-
-
-
-    /* Read the non-option arguments: */
+    /* Read the non-option tokens (arguments): */
     case ARGP_KEY_ARG:
-
-      /* Add the argument to the list of tokens: */
-      gal_linkedlist_add_to_stll(&p->tokens, arg);
+      gal_linkedlist_add_to_stll(&p->tokens, arg, 1);
       break;
 
 
-
-
-
-    /* The command line options and arguments are finished. */
-    case ARGP_KEY_END:
-      if(p->cp.setdirconf==0 && p->cp.setusrconf==0
-         && p->cp.printparams==0)
-        {
-          if(state->arg_num==0)
-            argp_error(state, "no argument given");
-        }
-      break;
-
-
-
-
-
+    /* This is an option, set its value. */
     default:
-      return ARGP_ERR_UNKNOWN;
+      return gal_options_set_from_key(key, arg, options, &p->cp);
     }
 
-
   return 0;
 }
 
@@ -252,19 +173,21 @@ parse_opt(int key, char *arg, struct argp_state *state)
 
 
 
-/* Specify the children parsers: */
-struct argp_child children[]=
-  {
-    {&commonargp, 0, NULL, 0},
-    {0, 0, 0, 0}
-  };
-
-
+/* Define the child argp structure. */
+static struct argp
+gal_options_common_child = {gal_commonopts_options,
+                            gal_options_common_argp_parse,
+                            NULL, NULL, NULL, NULL, NULL};
 
+/* Use the child argp structure in list of children (only one for now). */
+static struct argp_child
+children[]=
+{
+  {&gal_options_common_child, 0, NULL, 0},
+  {0, 0, 0, 0}
+};
 
-
-/* Basic structure defining the whole argument reading process. */
-static struct argp thisargp = {options, parse_opt, args_doc,
-                               doc, children, NULL, NULL};
-
+/* Set all the necessary argp parameters. */
+static struct argp
+thisargp = {options, parse_opt, args_doc, doc, children, NULL, NULL};
 #endif
diff --git a/bin/arithmetic/arithmetic.c b/bin/arithmetic/arithmetic.c
index 35894a6..d5cbd08 100644
--- a/bin/arithmetic/arithmetic.c
+++ b/bin/arithmetic/arithmetic.c
@@ -345,13 +345,7 @@ reversepolish(struct imgarithparams *p)
 
 
   /* Set the output type. */
-  if(p->up.typeset && p->outtype!=p->operands->data->type)
-    {
-      d1=gal_data_copy_to_new_type(p->operands->data, p->outtype);
-      gal_data_free(p->operands->data, 0);
-    }
-  else
-    d1=p->operands->data;
+  d1=p->operands->data;
 
 
   /* If the final data structure has more than one element, write it as a
@@ -370,7 +364,8 @@ reversepolish(struct imgarithparams *p)
       /* Put a copy of the WCS structure from the reference image, it
          will be freed while freeing d1. */
       d1->wcs=p->refdata.wcs;
-      gal_fits_write_img(d1, p->cp.output, "Arithmetic", NULL, SPACK_STRING);
+      gal_fits_write_img(d1, p->cp.output, "Arithmetic", NULL,
+                         PROGRAM_STRING);
     }
 
 
diff --git a/bin/arithmetic/cite.h b/bin/arithmetic/authors-cite.h
similarity index 57%
rename from bin/arithmetic/cite.h
rename to bin/arithmetic/authors-cite.h
index 5e853ef..4867cfb 100644
--- a/bin/arithmetic/cite.h
+++ b/bin/arithmetic/authors-cite.h
@@ -5,7 +5,7 @@ Arithmetic is part of GNU Astronomy Utilities (Gnuastro) 
package.
 Original author:
      Mohammad Akhlaghi <address@hidden>
 Contributing author(s):
-Copyright (C) 2015, Free Software Foundation, Inc.
+Copyright (C) 2017, Free Software Foundation, Inc.
 
 Gnuastro is free software: you can redistribute it and/or modify it
 under the terms of the GNU General Public License as published by the
@@ -20,19 +20,19 @@ General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
 **********************************************************************/
-#ifndef CITE_H
-#define CITE_H
-
-#define ARITHMETICBIBTEX ""
-
-#define PRINTCITEABORT {                                                \
-    printf("\nWe hope %s has been useful for your research.\n"          \
-           "Citations are vital for the continued work on %s.\n"        \
-           "Thank you for citing it in your research paper.\n"          \
-           "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
-           SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
-           GAL_STRINGS_MAIN_BIBTEX, ARITHMETICBIBTEX);                  \
-    exit(EXIT_SUCCESS);                                                 \
-  }
+#ifndef AUTHORS_CITE_H
+#define AUTHORS_CITS_H
+
+/* When any specific citation is necessary, please add its BibTeX (from ADS
+   hopefully) to this variable along with a title decribing what this
+   paper/book does for the progarm in a short line. In the following line
+   put a row of `-' with the same length and then put the BibTeX.
+
+   See the `gnuastro_bibtex' variable in `lib/options' (from the top
+   Gnuastro source code directory) as an example.*/
+
+#define PROGRAM_BIBTEX "";
+
+#define PROGRAM_AUTHORS "Mohammad Akhlaghi";
 
 #endif
diff --git a/bin/arithmetic/main.c b/bin/arithmetic/main.c
index ad723a2..59fdafd 100644
--- a/bin/arithmetic/main.c
+++ b/bin/arithmetic/main.c
@@ -36,7 +36,7 @@ int
 main (int argc, char *argv[])
 {
   struct timeval t1;
-  struct imgarithparams p={{0}, {0}, 0};
+  struct imgarithparams p={{0}, 0};
 
   /* Set the starting time. */
   time(&p.rawtime);
diff --git a/bin/arithmetic/main.h b/bin/arithmetic/main.h
index 2e4409a..6a2620a 100644
--- a/bin/arithmetic/main.h
+++ b/bin/arithmetic/main.h
@@ -26,24 +26,21 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <gnuastro/fits.h>
 #include <gnuastro/linkedlist.h>
 
-#include <commonparams.h>
+#include <options.h>
 
-/* Progarm name macros: */
-#define SPACK           "astarithmetic"   /* Subpackage executable name. */
-#define SPACK_NAME      "Arithmetic"      /* Subpackage full name.       */
-#define SPACK_STRING    SPACK_NAME" ("PACKAGE_NAME") "PACKAGE_VERSION
 
+/* Progarm name macros: */
+#define PROGRAM_NAME "Arithmetic"      /* Program full name.       */
+#define PROGRAM_EXEC "astarithmetic"   /* Program executable name. */
+#define PROGRAM_STRING PROGRAM_NAME" (" PACKAGE_NAME ") " PACKAGE_VERSION
 
-/* Do not use the main commonargs.h option reader for the --hdu
-   option. */
-#define NOTCOMMONHDU   1
 
 
 
 
 
 /* Constants: */
-#define NEGDASHREPLACE 11  /* A vertical tab (ASCII=11) for negative dash */
+#define NEG_DASH_REPLACE 11 /* Vertical tab (ASCII=11) for negative dash */
 
 
 
@@ -64,38 +61,19 @@ struct operand
 
 
 
-struct uiparams
-{
-  char        *maskname;   /* Name of mask image.                   */
-  char            *mhdu;   /* Mask image HDU.                       */
-
-  int           typeset;
-  int       masknameset;
-  int masknameallocated;
-  int           mhduset;
-};
-
-
-
-
 
 struct imgarithparams
 {
   /* Other structures: */
-  struct uiparams         up;  /* User interface parameters.            */
-  struct gal_commonparams cp;  /* Common parameters.                    */
+  struct gal_options_common_params cp;  /* Common parameters.           */
 
   /* Input: */
-  struct gal_linkedlist_stll *hdus; /* List of all given HDU strings.   */
+  struct gal_linkedlist_stll   *hdus; /* List of all given HDU strings. */
   struct gal_linkedlist_stll *tokens; /* List of all arithmetic tokens. */
-  size_t           numfits;  /* Total number of input FITS images.      */
   size_t        addcounter;  /* The number of FITS images added.        */
   size_t        popcounter;  /* The number of FITS images popped.       */
   gal_data_t       refdata;  /* Container for information of the data.  */
 
-  /* Output: */
-  int              outtype;  /* User's desired output bixpix value.     */
-
   /* Operating mode: */
 
   /* Internal: */
diff --git a/bin/arithmetic/operands.c b/bin/arithmetic/operands.c
index eea13c9..1ad1190 100644
--- a/bin/arithmetic/operands.c
+++ b/bin/arithmetic/operands.c
@@ -100,9 +100,8 @@ pop_operand(struct imgarithparams *p, char *operator)
 {
   size_t i;
   gal_data_t *data;
-  struct uiparams *up=&p->up;
+  char *filename, *hdu;
   struct operand *operands=p->operands;
-  char *maskname, *mhdu, *filename, *hdu;
 
   /* If the operand linked list has finished, then give an error and
      exit. */
@@ -118,19 +117,14 @@ pop_operand(struct imgarithparams *p, char *operator)
       hdu=operands->hdu;
       filename=operands->filename;
 
-      /* In case this is the first image that is read, then read the
-         WCS information and set the mask name so masked pixels can be
-         set to NaN. For the other images, the mask can be completely
-         ignored. */
-      mhdu     = p->popcounter ? NULL : up->mhdu;
-      maskname = p->popcounter ? NULL : up->maskname;
+      /* In case this is the first image that is read, then read the WCS
+         information.*/
       if(p->popcounter==0)
         gal_fits_read_wcs(filename, hdu, 0, 0, &p->refdata.nwcs,
                           &p->refdata.wcs);
 
       /* Read the input image as a double type array. */
-      data=gal_fits_read_img_hdu(filename, hdu, maskname, mhdu,
-                                 p->cp.minmapsize);
+      data=gal_fits_read_img_hdu(filename, hdu, p->cp.minmapsize);
 
       /* When the reference data structure's dimensionality is non-zero, it
          means that this is not the first image read. So, write its basic
@@ -168,7 +162,7 @@ pop_operand(struct imgarithparams *p, char *operator)
       ++p->popcounter;
 
       /* Report the read image if desired: */
-      if(p->cp.verb) printf("%s is read.\n", filename);
+      if(!p->cp.quiet) printf("%s is read.\n", filename);
     }
   else
     data=operands->data;
diff --git a/bin/arithmetic/ui.c b/bin/arithmetic/ui.c
index 71c6950..5b7cdfa 100644
--- a/bin/arithmetic/ui.c
+++ b/bin/arithmetic/ui.c
@@ -22,36 +22,24 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 **********************************************************************/
 #include <config.h>
 
-#include <math.h>
-#include <stdio.h>
+#include <argp.h>
 #include <errno.h>
 #include <error.h>
-#include <stdlib.h>
-#include <string.h>
-#include <fitsio.h>
+#include <stdio.h>
 
 #include <gnuastro/fits.h>
+#include <gnuastro/table.h>
+#include <gnuastro/linkedlist.h>
 
-#include <nproc.h>               /* From Gnulib.                   */
-#include <timing.h>              /* Includes time.h and sys/time.h */
+#include <nproc.h>  /* from Gnulib, in Gnuastro's source */
+#include <timing.h>
+#include <options.h>
 #include <checkset.h>
-#include <commonargs.h>
-#include <configfiles.h>
-#include <fixedstringmacros.h>
 
 #include "main.h"
 
-#include "ui.h"                  /* Needs main.h                   */
-#include "args.h"                /* Needs main.h, includes argp.h. */
-
-
-/* Set the file names of the places where the default parameters are
-   put. */
-#define CONFIG_FILE SPACK CONF_POSTFIX
-#define SYSCONFIG_FILE SYSCONFIG_DIR "/" CONFIG_FILE
-#define USERCONFIG_FILEEND USERCONFIG_DIR CONFIG_FILE
-#define CURDIRCONFIG_FILE CURDIRCONFIG_DIR CONFIG_FILE
-
+#include "ui.h"
+#include "args.h"
 
 
 
@@ -62,239 +50,65 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 /**************************************************************/
-/**************       Options and parameters    ***************/
+/***************       Sanity Check         *******************/
 /**************************************************************/
-void
-readconfig(char *filename, struct imgarithparams *p)
+/* Sanity check ONLY on options. When arguments are involved, do the check
+   in `ui_check_options_and_arguments'. */
+static void
+ui_read_check_only_options(struct imgarithparams *p)
 {
-  FILE *fp;
-  char *tokeephdu;
-  size_t lineno=0, len=200;
-  char *line, *name, *value;
-  struct uiparams *up=&p->up;
-  struct gal_commonparams *cp=&p->cp;
-  char key='a';        /* Not used, just a place holder. */
-
-  /* When the file doesn't exist or can't be opened, it is ignored. It
-     might be intentional, so there is no error. If a parameter is
-     missing, it will be reported after all defaults are read. */
-  fp=fopen(filename, "r");
-  if (fp==NULL) return;
-
-
-  /* Allocate some space for `line` with `len` elements so it can
-     easily be freed later on. The value of `len` is arbitarary at
-     this point, during the run, getline will change it along with the
-     pointer to line. */
-  errno=0;
-  line=malloc(len*sizeof *line);
-  if(line==NULL)
-    error(EXIT_FAILURE, errno, "ui.c: %zu bytes in readdefaults",
-          len * sizeof *line);
-
-  /* Read the tokens in the file:  */
-  while(getline(&line, &len, fp) != -1)
-    {
-      /* Prepare the "name" and "value" strings, also set lineno. */
-      GAL_CONFIGFILES_START_READING_LINE;
-
-
-
-      /* Inputs: */
-      if(strcmp(name, "hdu")==0)
-        {
-          gal_checkset_allocate_copy(value, &tokeephdu);
-          gal_linkedlist_add_to_stll(&p->hdus, tokeephdu);
-        }
-
-      else if (strcmp(name, "mask")==0)
-        gal_checkset_allocate_copy_set(value, &up->maskname,
-                                       &up->masknameset);
-
-      else if (strcmp(name, "mhdu")==0)
-        gal_checkset_allocate_copy_set(value, &up->mhdu, &up->mhduset);
-
-
-
-
+  size_t i;
+  struct gal_linkedlist_stll *namell=NULL, *docll=NULL;
 
-      /* Outputs */
-      else if(strcmp(name, "output")==0)
-        gal_checkset_allocate_copy_set(value, &cp->output,
-                                       &cp->outputset);
-      else if(strcmp(name, "type")==0)
+  /* Put the program's option values into the structure. */
+  for(i=0; !gal_options_is_last(&options[i]); ++i)
+    if( options[i].key && options[i].name )
+      switch(options[i].key)
         {
-          if(p->up.typeset) continue;
-          gal_checkset_known_types(value, &p->outtype, filename, lineno);
-          p->up.typeset=1;
-        }
-
-
-      /* Operating modes: */
-      /* Read options common to all programs */
-      GAL_CONFIGFILES_READ_COMMONOPTIONS_FROM_CONF
-
-
-      else
-        error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                      "`%s` not recognized.\n", name);
-    }
-
-  free(line);
-  fclose(fp);
-}
-
-
-
-
-
-void
-printvalues(FILE *fp, struct imgarithparams *p)
-{
-  struct uiparams *up=&p->up;
-  struct gal_linkedlist_stll *hdu;
-  struct gal_commonparams *cp=&p->cp;
-
-  /* Print all the options that are set. Separate each group with a
-     commented line explaining the options in that group. */
-  fprintf(fp, "\n# Input image(s):\n");
-
-  /* The order of the HDU linked list has already been corrected, so
-     just print them as they were read in. */
-  for(hdu=p->hdus; hdu!=NULL; hdu=hdu->next)
-    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("hdu", hdu->v);
-
-  if(up->masknameset)
-    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("mask", up->maskname);
-  if(up->mhdu)
-    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("mhdu", up->mhdu);
-
-  /* Output: */
-  fprintf(fp, "\n# Output:\n");
-  if(cp->outputset)
-    fprintf(fp, CONF_SHOWFMT"%s\n", "output", cp->output);
-  if(up->typeset)
-    gal_configfiles_print_type(fp, p->outtype);
-
-
-  /* For the operating mode, first put the macro to print the common
-     options, then the (possible options particular to this
-     program). */
-  fprintf(fp, "\n# Operating mode:\n");
-  GAL_CONFIGFILES_PRINT_COMMONOPTIONS;
-}
-
-
-
-
-
-
-/* Note that numthreads will be used automatically based on the
-   configure time. Note that those options which are not mandatory
-   must not be listed here. */
-void
-checkifset(struct imgarithparams *p)
-{
-  int intro=0;
-  char comment[100];
-  size_t numhdus=gal_linkedlist_num_in_stll(p->hdus);
-
-  /* Operating modes: */
-  if(p->cp.minmapsizeset==0)
-    GAL_CONFIGFILES_REPORT_NOTSET("minmapsize");
-
-  /* Make sure the number of HDUs is not less than the total number of
-     FITS images. If there are more HDUs than there are FITS images,
-     there is no problem (since they can come from the configuration
-     files). It is expected that the user can call their own desired
-     number of HDUs, and not rely on the configuration files too much,
-     however, if the configuration file does contain some HDUs, then
-     it will be a real pain to first clean the configuration file and
-     then re-run arithmetic. The best way is to simply ignore them. */
-  if(numhdus<p->numfits)
-    {
-      sprintf(comment, "hdu (%zu FITS file(s), %zu HDUs)",
-              p->numfits, numhdus);
-      GAL_CONFIGFILES_REPORT_NOTSET(comment);
-    }
-
-  /* Report the (possibly) missing options. */
-  GAL_CONFIGFILES_END_OF_NOTSET_REPORT;
-}
-
+        /* Inputs */
+        case ARGS_OPTION_HDU_KEY:
+          gal_linked_list_copy_stll(options[i].value, &p->hdus);
+          break;
 
 
 
+        /* Output */
 
 
 
+        /* Operating mode */
 
 
 
+        default:
+          error(EXIT_FAILURE, 0, "option key %d not recognized in "
+                "`fill_params_from_options'", options[i].key);
+        }
 
-
-
-
-
-
-
-
-
-
-/**************************************************************/
-/***************       Sanity Check         *******************/
-/**************************************************************/
-
-/* The dash of a negative number will cause problems for the users,
-   so to work properly we will go over all the options/arguments and
-   if any one starts with a dash and is followed by a number, then
-   the dash is replaced by NEGDASHREPLACE. */
-void
-dashtonegchar(int argc, char *argv[])
-{
-  size_t i;
-  for(i=0;i<argc;++i)
-    if(argv[i][0]=='-' && isdigit(argv[i][1]))
-      argv[i][0]=NEGDASHREPLACE;
+  /* If any of the mandatory options were not given, then print an error
+     listing them and abort. */
+  if(namell)
+    gal_options_mandatory_error(namell, docll);
 }
 
 
 
 
 
-/* Return the negative character back to the dash (to be read as a
-   number in imgarith.c). When the token is not a FITS file name and
-   since no operators or numbers begin with NEGDASHREPLACE, so if the
-   token starts with NEGDASHREPLACE and its next character is a digit,
-   it must be a negative number. If not, it is either an ordinary
-   number or an operator.*/
-void
-negchartodashcountfits(struct imgarithparams *p)
+/* Sanity check on options AND arguments. If only option values are to be
+   checked, use `ui_read_check_only_options'. */
+static void
+ui_check_options_and_arguments(struct imgarithparams *p)
 {
-  struct gal_linkedlist_stll *token;
+  int output_checked=0;
+  size_t numfits=0, numhdus=0;
+  struct gal_linkedlist_stll *token, *hdu;
 
-  /* Initialize the numfits variable (just incase!) */
-  p->numfits=0;
-
-  /* Go through all the tokens and do the job(s). */
-  for(token=p->tokens; token!=NULL; token=token->next)
-    {
-      if(gal_fits_name_is_fits(token->v))
-        ++p->numfits;
-      else if(token->v[0]==NEGDASHREPLACE && isdigit(token->v[1]) )
-        token->v[0]='-';
-    }
-}
-
-
-
-
-
-/* Standard sanity checks. */
-void
-sanitycheck(struct imgarithparams *p)
-{
-  struct gal_linkedlist_stll *token;
+  /* The inputs are put in a lastin-firstout (simple) linked list, so
+     change them to the correct order so the order we pop a token is the
+     same order that the user input a value. */
+  gal_linkedlist_reverse_stll(&p->hdus);
+  gal_linkedlist_reverse_stll(&p->tokens);
 
   /* Set the output file name (if any is needed). Note that since the
      lists are already reversed, the first FITS file encountered, is
@@ -302,25 +116,42 @@ sanitycheck(struct imgarithparams *p)
      file name operations are only necessary for the first FITS file
      in the token list. */
   for(token=p->tokens; token!=NULL; token=token->next)
-    if(gal_fits_name_is_fits(token->v))
     {
-      /* Set the p->up.maskname accordingly: */
-      gal_fits_file_or_ext_name(token->v, p->cp.hdu,
-                                p->up.masknameset, &p->up.maskname,
-                                p->up.mhdu, p->up.mhduset, "mask");
-
-      /* Set the name of the output file: */
-      if(p->cp.outputset)
-        gal_checkset_check_remove_file(p->cp.output, p->cp.dontdelete);
-      else
-        gal_checkset_automatic_output(token->v, "_arith.fits",
-                                      p->cp.removedirinfo,
-                                      p->cp.dontdelete, &p->cp.output);
-
-      /* These were only necessary for the first FITS file in the
-         tokens, so break out of the loop. */
-      break;
+      /* This token is a FITS file, count them and use it to set the output
+         filename if it has not been set. */
+      if(gal_fits_name_is_fits(token->v))
+        {
+          /* Increment the counter for FITS files. */
+          ++numfits;
+
+          /* If the output filename isn't set yet, then set it. */
+          if(output_checked)
+            {
+              if(p->cp.output)
+                gal_checkset_check_remove_file(p->cp.output,
+                                               p->cp.dontdelete);
+              else
+                p->cp.output=gal_checkset_automatic_output(&p->cp, token->v,
+                                                           "_arith.fits");
+              output_checked=1;
+            }
+        }
+
+      /* This token is a number. Check if a negative dash was present that
+         has been temporarily replaced with `NEG_DASH_REPLACE' before
+         option parsing. */
+      else if(token->v[0]==NEG_DASH_REPLACE && isdigit(token->v[1]) )
+        token->v[0]='-';
     }
+
+  /* Count the number of HDU values and check if its not less than the
+     number of input FITS images. */
+  for(hdu=p->hdus; hdu!=NULL; hdu=hdu->next) ++numhdus;
+  if(numhdus<numfits)
+    error(EXIT_FAILURE, 0, "not enough HDUs. There are %zu input FITS "
+          "files, but only %zu HDUs. You can use the `--hdu' (`-h') option "
+          "to specify the number or name of a HDU for each FITS file",
+          numfits, numhdus);
 }
 
 
@@ -348,51 +179,52 @@ sanitycheck(struct imgarithparams *p)
 void
 setparams(int argc, char *argv[], struct imgarithparams *p)
 {
-  struct gal_commonparams *cp=&p->cp;
+  size_t i;
+  struct gal_options_common_params *cp=&p->cp;
 
   /* Set the non-zero initial values, the structure was initialized to
-     have a zero value for all elements. */
-  cp->spack         = SPACK;
-  cp->verb          = 1;
-  cp->numthreads    = num_processors(NPROC_CURRENT);
-  cp->removedirinfo = 1;
-
-  p->hdus           = NULL;
-  p->tokens         = NULL;
-  p->up.maskname    = NULL;
-
-  /* The hyphen of a negative number can be confused with a dash, so
-     we will temporarily replace such hyphens with other
-     characters. */
-  dashtonegchar(argc, argv);
-
-  /* Read the arguments. */
+     have a zero/NULL value for all elements. */
+  cp->poptions        = options;
+  cp->program_name    = PROGRAM_NAME;
+  cp->program_exec    = PROGRAM_EXEC;
+  cp->program_bibtex  = PROGRAM_BIBTEX;
+  cp->program_authors = PROGRAM_AUTHORS;
+  cp->coptions        = gal_commonopts_options;
+  cp->numthreads      = num_processors(NPROC_CURRENT);
+
+  /* The dash of a negative number will cause problems with the option
+     readin. To work properly we will go over all the options/arguments and
+     if any one starts with a dash and is followed by a number, then the
+     dash is replaced by NEG_DASH_REPLACE. */
+  for(i=0;i<argc;++i)
+    if(argv[i][0]=='-' && isdigit(argv[i][1]))
+      argv[i][0]=NEG_DASH_REPLACE;
+
+  /* Read the command-line options and arguments. */
   errno=0;
   if(argp_parse(&thisargp, argc, argv, 0, 0, p))
     error(EXIT_FAILURE, errno, "parsing arguments");
 
-  /* Revert the conversion of the hyphen above back to the original
-     character. */
-  negchartodashcountfits(p);
-
-  /* Add the user default values and save them if asked. */
-  GAL_CONFIGFILES_CHECK_SET_CONFIG;
+  /* Read the configuration files. */
+  gal_options_read_config_files(cp);
 
-  /* The inputs are put in a lastin-firstout (simple) linked list, so
-     change them to the correct order so the order we pop a node is
-     the same order that the user input a value. */
-  gal_linkedlist_reverse_stll(&p->hdus);
-  gal_linkedlist_reverse_stll(&p->tokens);
+  /* Read the options into the program's structure, and check them and
+     their relations prior to printing. */
+  ui_read_check_only_options(p);
 
-  /* Check if all the required parameters are set. */
-  checkifset(p);
+  /* Print the option values if asked. Note that this needs to be done
+     after the sanity check so un-sane values are not printed in the output
+     state. */
+  gal_options_print_state(cp);
 
-  /* Print the values for each parameter. */
-  if(cp->printparams)
-      GAL_CONFIGFILES_REPORT_PARAMETERS_SET;
+  /* Check that the options and arguments fit well with each other. Note
+     that arguments don't go in a configuration file. So this test should
+     be done after (possibly) printing the option values. */
+  ui_check_options_and_arguments(p);
 
-  /* Do a sanity check. */
-  sanitycheck(p);
+  /* Free all the allocated spaces in the option structures. */
+  gal_options_free(options);
+  gal_options_free(gal_commonopts_options);
 }
 
 
@@ -428,6 +260,6 @@ freeandreport(struct imgarithparams *p, struct timeval *t1)
     gal_linkedlist_free_stll(p->hdus, 1);
 
   /* Report the duration of the job */
-  if(p->cp.verb)
-    gal_timing_report(t1, SPACK_NAME" finished in", 0);
+  if(!p->cp.quiet)
+    gal_timing_report(t1,  PROGRAM_NAME" finished in", 0);
 }
diff --git a/bin/table/args.h b/bin/table/args.h
index e151160..4048599 100644
--- a/bin/table/args.h
+++ b/bin/table/args.h
@@ -27,37 +27,36 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 
-/* Include the common options to all Gnuastro programs. If the program has
-   its own HDU parsing procedure, then define the `NOT_COMMON_HDU_PARSER'
-   macro before including the `commonopts.h' header. */
+/* Include necessary headers. */
 #include <commonopts.h>
+#include <authors-cite.h>
+#include <fixedstringmacros.h>
 
 
 
 
-/* Definition parameters for the argp: */
-const char *argp_program_version =
-  PROGRAM_NAME" (" PACKAGE_NAME ") " PACKAGE_VERSION "\n"
-  GAL_STRINGS_COPYRIGHT
-  "\n\nWritten/developed by Mohammad Akhlaghi";
-const char *argp_program_bug_address=PACKAGE_BUGREPORT;
-static char args_doc[] = "ASTRdata";
 
+/* Definition parameters for the Argp: */
+const char *
+argp_program_version = PROGRAM_STRING "\n"
+                       GAL_STRINGS_COPYRIGHT
+                       "\n\nWritten/developed by "PROGRAM_AUTHORS;
 
+const char *
+argp_program_bug_address = PACKAGE_BUGREPORT;
 
+static char
+args_doc[] = "ASTRdata";
 
-
-const char doc[] =
-  /* Before the list of options: */
-  GAL_STRINGS_TOP_HELP_INFO
-  PROGRAM_NAME" can be used to view the information, select columns, or "
-  "convert tables. The inputs and outputs can be plain text (with "
-  "whitespace or comma as delimiters), FITS ascii, or FITS binary tables. "
-  "The output columns can either be selected by number (counting from 1), "
-  "name or using regular expressions. For regular expressions, enclose the "
-  "value to the `--column' (`-c') option in slashes (`\\', as in "
-  "`-c\\^mag\\'). To print the selected columns on the command-line, don't "
-  "specify an output file.\n"
+const char
+doc[] = GAL_STRINGS_TOP_HELP_INFO PROGRAM_NAME" can be used to view the "
+  "information, select columns, or convert tables. The inputs and outputs "
+  "can be plain text (with whitespace or comma as delimiters), FITS ascii, "
+  "or FITS binary tables. The output columns can either be selected by "
+  "number (counting from 1), name or using regular expressions. For regular "
+  "expressions, enclose the value to the `--column' (`-c') option in "
+  "slashes (`\\', as in `-c\\^mag\\'). To print the selected columns on the "
+  "command-line, don't specify an output file.\n"
   GAL_STRINGS_MORE_HELP_INFO
   /* After the list of options: */
   "\v"
@@ -80,7 +79,8 @@ enum option_keys_enum
   ARGS_OPTION_TABLETYPE_KEY   = 't',
   ARGS_OPTION_INFORMATION_KEY = 'i',
 
-  /* Only with long version. */
+  /* Only with long version (start with a value 1000, the rest will be set
+     automatically). */
 };
 
 /* Array of acceptable options. */
@@ -208,16 +208,20 @@ parse_opt(int key, char *arg, struct argp_state *state)
 
 
 /* Define the child argp structure. */
-static struct argp gal_options_common_child = {gal_commonopts_options,
-                                               gal_options_common_argp_parse,
-                                               NULL, NULL, NULL, NULL, NULL};
-
-static struct argp_child children[]=
-  {
-    {&gal_options_common_child, 0, NULL, 0},
-    {0, 0, 0, 0}
-  };
+static struct argp
+gal_options_common_child = {gal_commonopts_options,
+                            gal_options_common_argp_parse,
+                            NULL, NULL, NULL, NULL, NULL};
+
+/* Use the child argp structure in list of children (only one for now). */
+static struct argp_child
+children[]=
+{
+  {&gal_options_common_child, 0, NULL, 0},
+  {0, 0, 0, 0}
+};
 
-static struct argp thisargp = {options, parse_opt, args_doc,
-                               doc, children, NULL, NULL};
+/* Set all the necessary argp parameters. */
+static struct argp
+thisargp = {options, parse_opt, args_doc, doc, children, NULL, NULL};
 #endif
diff --git a/bin/table/main.h b/bin/table/main.h
index 9760c3e..bc51615 100644
--- a/bin/table/main.h
+++ b/bin/table/main.h
@@ -31,7 +31,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 /* Progarm names.  */
 #define PROGRAM_NAME "Table"         /* Program full name.       */
 #define PROGRAM_EXEC "asttable"      /* Program executable name. */
-
+#define PROGRAM_STRING PROGRAM_NAME" (" PACKAGE_NAME ") " PACKAGE_VERSION
 
 
 
diff --git a/bin/table/ui.c b/bin/table/ui.c
index 163f857..2b3e865 100644
--- a/bin/table/ui.c
+++ b/bin/table/ui.c
@@ -23,29 +23,22 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <config.h>
 
 #include <argp.h>
-#include <math.h>
-#include <stdio.h>
 #include <errno.h>
 #include <error.h>
-#include <regex.h>
-#include <stdlib.h>
-#include <string.h>
-#include <fitsio.h>
+#include <stdio.h>
 
 #include <gnuastro/fits.h>
 #include <gnuastro/table.h>
 #include <gnuastro/linkedlist.h>
 
-#include <nproc.h>               /* From Gnulib.                   */
-#include <timing.h>              /* Includes time.h and sys/time.h */
-#include <checkset.h>
-#include <fixedstringmacros.h>
+#include <nproc.h> /* from Gnulib, in Gnuastro's source */
+#include <timing.h>
+#include <options.h>
 
 #include "main.h"
 
 #include "ui.h"
 #include "args.h"
-#include "authors-cite.h"
 
 
 
@@ -118,8 +111,8 @@ ui_read_check_only_options(struct tableparams *p)
               /* If the output name was set and is a FITS file, make sure
                  that the type of the table is not a `txt'. */
               if( p->cp.output && gal_fits_name_is_fits(p->cp.output)
-                  && ( p->tabletype !=GAL_TABLE_TYPE_AFITS
-                       && p->tabletype !=GAL_TABLE_TYPE_BFITS ) )
+                 && ( p->tabletype != GAL_TABLE_TYPE_AFITS
+                       && p->tabletype != GAL_TABLE_TYPE_BFITS ) )
                 error(EXIT_FAILURE, 0, "desired output file `%s' is a FITS "
                       "file, but `tabletype' is not a FITS table type. "
                       "Please set it to `fits-ascii', or `fits-binary'",
@@ -130,8 +123,7 @@ ui_read_check_only_options(struct tableparams *p)
              FITS file, A text table output only has one possible type. */
           else if( gal_fits_name_is_fits(p->cp.output) )
             gal_options_add_to_not_given(&options[i], &namell, &docll);
-          break;
-
+         break;
 
 
         /* Operating mode */
@@ -141,6 +133,7 @@ ui_read_check_only_options(struct tableparams *p)
           break;
 
 
+
         default:
           error(EXIT_FAILURE, 0, "option key %d not recognized in "
                 "`fill_params_from_options'", options[i].key);
@@ -300,36 +293,34 @@ ui_preparations(struct tableparams *p)
 void
 setparams(int argc, char *argv[], struct tableparams *p)
 {
+  struct gal_options_common_params *cp=&p->cp;
+
   /* Set the non-zero initial values, the structure was initialized to
-     have a zero value for all elements. */
-  p->cp.poptions        = options;
-  p->cp.program_name    = PROGRAM_NAME;
-  p->cp.program_exec    = PROGRAM_EXEC;
-  p->cp.program_bibtex  = PROGRAM_BIBTEX;
-  p->cp.program_authors = PROGRAM_AUTHORS;
-  p->cp.coptions        = gal_commonopts_options;
-  p->cp.numthreads      = num_processors(NPROC_CURRENT);
-
-  /* Initialize this utility's pointers to NULL. */
-  p->columns=NULL;
-  p->up.filename=NULL;
-
-  /* Read the command-line arguments. */
+     have a zero/NULL value for all elements. */
+  cp->poptions        = options;
+  cp->program_name    = PROGRAM_NAME;
+  cp->program_exec    = PROGRAM_EXEC;
+  cp->program_bibtex  = PROGRAM_BIBTEX;
+  cp->program_authors = PROGRAM_AUTHORS;
+  cp->coptions        = gal_commonopts_options;
+  cp->numthreads      = num_processors(NPROC_CURRENT);
+
+  /* Read the command-line options and arguments. */
   errno=0;
   if(argp_parse(&thisargp, argc, argv, 0, 0, p))
     error(EXIT_FAILURE, errno, "parsing arguments");
 
   /* Read the configuration files. */
-  gal_options_read_config_files(&p->cp);
+  gal_options_read_config_files(cp);
 
   /* Read the options into the program's structure, and check them and
      their relations prior to printing. */
   ui_read_check_only_options(p);
 
   /* Print the option values if asked. Note that this needs to be done
-     after the sanity check so un-sane values are not printed in the output
-     state. */
-  gal_options_print_state(&p->cp);
+     after the option checks so un-sane values are not printed in the
+     output state. */
+  gal_options_print_state(cp);
 
   /* Check that the options and arguments fit well with each other. Note
      that arguments don't go in a configuration file. So this test should
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 411846f..5acd0ed 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -408,7 +408,6 @@ SubtractSky
 
 * Sky value::                   Definition of the sky value.
 * Tiling an image::             Defining a mesh grid on the image.
-* Mask image::                  How to mask pixels for no analysis.
 * Invoking astsubtractsky::     Options and arguments to SubtractSky.
 
 Sky value
@@ -7887,10 +7886,11 @@ floating point number in Gnuastro isn't case-sensitive.
 @subsection Invoking Arithmetic
 
 Arithmetic will do pixel to pixel arithmetic operations on the individual
-pixels of input data and/or numbers. Any operand that only has a single
-element (number, or single pixel FITS image file) will be read as a number,
-the rest of the inputs must have the same dimensions. The general template
-is:
+pixels of input data and/or numbers. For the full list of operators with
+explanations, please see @ref{Arithmetic operators}. Any operand that only
+has a single element (number, or single pixel FITS image) will be read as a
+number, the rest of the inputs must have the same dimensions. The general
+template is:
 
 @example
 $ astarithmetic [OPTION...] ASTRdata1 [ASTRdata2] OPERATOR ...
@@ -7914,13 +7914,45 @@ $ astarithmetic img1.fits img2.fits img3.fits median    
            \
 If the output is an image, and the @option{--output} option is not given,
 automatic output will use the name of the first FITS image encountered to
 generate an output file name, see @ref{Automatic output}. Also, output WCS
-information will be taken from the first input image encountered. If the
+information will be taken from the first input image encountered. When the
 output is a single number, that number will be printed in the standard
-output. See @ref{Reverse polish notation} for the notation used to mix
-operands and operators on the command-line. To ignore certain pixels (see
address@hidden pixels}), you can specify a mask image, see @ref{Mask image}. In
-that case, when reading the first FITS image, all the masked pixels will be
-set to a blank value depending on the type of the image.
+output and no output file will be created. Arithmetic's notation for giving
+operands to operators is described in @ref{Reverse polish notation}. To
+ignore certain pixels, set them as blank, see @ref{Blank pixels}, for
+example with the @command{where} operator (see @ref{Arithmetic
+operators}). See @ref{Common options} for a review of the options in all
+Gnuastro programs. Arithmetic just redefines the @option{--hdu} option as
+explained below:
+
address@hidden @option
+
address@hidden -h INT/STR
address@hidden --hdu INT/STR
+The header data unit of the input FITS images, see @ref{Input
+output}. Unlike most options in Gnuastro (which will ultimately only have
+one value for this option), Arithmetic allows @option{--hdu} to be called
+multiple times and the value of each invocation will be stored separately
+(for the unlimited number of input images you would like to use). Recall
+that for other programs this (common) option only takes a single value. So
+in other programs, if you specify it multiple times on the command-line,
+only the last value will be used and in the configuration files, it will be
+ignored if it already has a value.
+
+The order of the values to @option{--hdu} has to be in the same order as
+input FITS images. Options are first read from the command-line (from left
+to right), then top-down in each configuration file, see @ref{Configuration
+file precedence}.
+
+If the number of HDUs is less than the number of input images,
+Arithmetic will abort and notify you. However, if there are more HDUs
+than FITS images, there is no problem: they will be used in the given
+order (every time a FITS image comes up on the stack) and the extra
+HDUs will be ignored in the end. So there is no problem with having
+extra HDUs in the configuration files and by default several HDUs with
+a value of @option{0} are kept in the system-wide configuration file
+when you install Gnuastro.
+
address@hidden table
 
 Arithmetic accepts two kinds of input: images and numbers. Images are
 considered to be any of the inputs that is a file name of a recognized type
@@ -8015,36 +8047,7 @@ $ echo "" | awk '@{print (10.32-3.84)address@hidden'
 @end example
 
 
-See @ref{Common options} for a review of the options in all Gnuastro
-programs, the two options related to a mask image are also specified
-in @ref{Mask image}. Arithmetic just redefines the @option{--hdu}
-option as explained below:
-
address@hidden @option
-
address@hidden -h INT/STR
address@hidden --hdu INT/STR
-Unlike most options in Gnuastro (which will ultimately only have one value
-for this option), Arithmetic allows @option{--hdu} to be called multiple
-times and the value of each invocation will be stored separately (for the
-unlimited number of input images you would like to use).
-
-The order of the values to @option{--hdu} is very important (if they
-don't have the same value!). The order is determined by the order that
-this option is read: first on the command-line (from left to right),
-then top-down in each configuration file, see @ref{Configuration file
-precedence}.
-
-If the number of HDUs is less than the number of input images,
-Arithmetic will abort and notify you. However, if there are more HDUs
-than FITS images, there is no problem: they will be used in the given
-order (every time a FITS image comes up on the stack) and the extra
-HDUs will be ignored in the end. So there is no problem with having
-extra HDUs in the configuration files and by default several HDUs with
-a value of @option{0} are kept in the system-wide configuration file
-when you install Gnuastro.
 
address@hidden table
 
 
 
@@ -8212,20 +8215,18 @@ edge of the image, the brightness (sum of its pixel 
fluxes within the
 image, see @ref{Flux Brightness and magnitude}) will not be equal,
 some of the flux is going to be `eaten' by the edges.
 
-If you ran @command{$ make check} on the source files of Gnuastro, you
-can see the this effect by comparing the
address@hidden with @file{convolve_spatial.fits} in
-the @file{./tests/} directory. In the spatial domain, by default, no
-assumption will be made about pixels outside of the image or any blank
-pixels in the image, see @ref{Blank pixels}. The problem explained
-above will also occur on the sides of blank regions (which might be
-masked for example). The solution to this edge effect problem is only
-possible in the spatial domain. We have to discard the assumption that
-the sum of the kernel pixels is unity during the convolution
address@hidden the sum of the kernel pixels still have to
-be unity.}. So taking @mymath{W} as the sum of the kernel pixels that
-used non-blank and in-image pixels, the equation in @ref{Convolution
-process} will become:
+If you ran @command{$ make check} on the source files of Gnuastro, you can
+see the this effect by comparing the @file{convolve_frequency.fits} with
address@hidden in the @file{./tests/} directory. In the
+spatial domain, by default, no assumption will be made about pixels outside
+of the image or any blank pixels in the image. The problem explained above
+will also occur on the sides of blank regions (see @ref{Blank pixels}). The
+solution to this edge effect problem is only possible in the spatial
+domain. We have to discard the assumption that the sum of the kernel pixels
+is unity during the convolution address@hidden the sum of the
+kernel pixels still have to be unity.}. So taking @mymath{W} as the sum of
+the kernel pixels that used non-blank and in-image pixels, the equation in
address@hidden process} will become:
 
 @dispmath{C_{x,y}= { \sum_{s=-a}^{a}\sum_{t=-b}^{b}K_{s,t}\times{}I_{x+s,y+t} 
\over W}.}
 
@@ -9320,11 +9321,9 @@ is defined, only channels and the mesh size are
 important. @ref{Convolution kernel} lists the the convolution kernel
 options.
 
-It is also possible to specify a mask image for the input. In that
-case, see @ref{Mask image}. Here we will only explain the options
-particular to Convolve. Run Convolve with @option{--help} in order to
-see the full list of options Convolve accepts, irrespective of where
-they are explained in this book.
+Here we will only explain the options particular to Convolve. Run Convolve
+with @option{--help} in order to see the full list of options Convolve
+accepts, irrespective of where they are explained in this book.
 
 @table @option
 
@@ -10094,7 +10093,6 @@ larger grid size.
 @menu
 * Sky value::                   Definition of the sky value.
 * Tiling an image::             Defining a mesh grid on the image.
-* Mask image::                  How to mask pixels for no analysis.
 * Invoking astsubtractsky::     Options and arguments to SubtractSky.
 @end menu
 
@@ -10283,7 +10281,7 @@ are ultimately poor approximations.
 
 
 
address@hidden Tiling an image, Mask image, Sky value, SubtractSky
address@hidden Tiling an image, Invoking astsubtractsky, Sky value, SubtractSky
 @subsection Tiling an image
 
 @cindex Grid
@@ -10704,74 +10702,8 @@ coordinate system.
 @end table
 
 
address@hidden Mask image, Invoking astsubtractsky, Tiling an image, SubtractSky
address@hidden Mask image
-
address@hidden Mask image
-All of the programs in Gnuastro that do processing on the input data
-can also account for masked pixels. Particularly in raw data
-processing, there are usually a set of pixels in the image that should
-not be included in any analysis. For example saturated pixels on the
-centers of bright objects, or the edges of the image which received no
-data and were only used for bias calculation. The detectors or the
-very early processing that is done on raw images clearly identifies
-such cases and usually assigns an integer (or flag or mask value) to
-those pixels. Pixels that are good for processing usually have a zero
-value in the mask image. It goes without saying that the two images
-have to have the same size. Note that if the mask image has blank
-pixels, then they act like pixels with non-zero values and will be
-masked (see @ref{Blank pixels}).
-
address@hidden Binary mask image values
-The integer values in the mask images are usually sums of powers of
-two. Each power of two has a specific meaning and since the sum of two
-different sets of powers of two are never equal, each mask value
-identifies a set of different properties for each masked pixels. For
-some analysis, some masked properties might not be a
-problem. Therefore a pixel that only has that property should be
-included. In such cases, you can use bit flags to keep some of the
-powers of two and remove the rest. The individual Gnuastro programs do
-not consider these issues. Therefore, if some masked pixels should be
-included in the analysis, it is best to use another tool to set the
-appropriate mask pixel values to zero prior to running the analysis
-program. We are working on such a program as part of Gnuastro. If the
-data type (@code{BITPIX}) of the input mask image is not an integer
-type, the programs will print a warning, but continue on with the
-analysis. This usually happens because of a mistake in specifying the
-file or the HDU.
-
address@hidden NaN
-The programs that accept a mask image, all share the options
-below. Any masked pixels will receive a NaN value (or a blank pixel,
-see @ref{Blank pixels}) in the final output of those programs.
-In fact, another way to notify any of the Gnuastro programs to not use
-a certain set of pixels in a data set is to set those pixels equal to
-appropriate blank pixel value for the type of the image, @ref{Blank
-pixels}.
-
address@hidden @option
-
address@hidden -M STR
address@hidden --mask=STR
-Mask image file name. If this option is not given and the @option{--mhdu}
-option has a different value from @option{--hdu}, then the input image name
-will be used. If a name is specified on the command-line or in any of the
-configuration files, it will be used. If the program doesn't get any mask
-file name, it will use all the non-blank (see @ref{Blank pixels}) pixels in
-the image. Therefore, specifying a mask file name in any of the
-configuration files is not mandatory.
-
address@hidden -H STR
address@hidden --mhdu=STR
-The mask image header name or number. Similar to the @option{--hdu} option,
-see @ref{Common options}. Like @option{--mask}, this option does not have
-to be included in the configuration file or the command-line. However, if
-it is present on either of them, it will be used.
-
address@hidden table
-
 
address@hidden Invoking astsubtractsky,  , Mask image, SubtractSky
address@hidden Invoking astsubtractsky,  , Tiling an image, SubtractSky
 @subsection Invoking SubtractSky
 
 SubtractSky will find the sky value on a grid in an image and subtract
@@ -10789,32 +10721,29 @@ One line examples:
 $ astsubtractsky image.fits
 $ astsubtractsky --hdu=0 --mhdu=1 image.fits
 $ astsubtractsky --nch1=2 --nch2=2 image.fits
-$ astsubtractsky --mask=maskforimage.fits image.fits
 @end example
 
 @cindex Blank pixel
 The only required input to SubtractSky is the input data file that
-currently has to be only a 2D image. But in the future it might be
-useful to use it for 1D or 3D data too. Any pixels in the image with a
-blank value will be ignored in the analysis, see @ref{Blank
-pixels}. Alternatively a mask can be specified which indicates pixels
-to not be used (see @option{--mask} and @option{--mhdu}). The common
-options to all Gnuastro programs can be seen in @ref{Common options}
-and input data formats are explained in @ref{Arguments}.
-
-SubtractSky uses a mesh grid to tile the image. This enables it to
-deal with possible gradients, see @ref{Tiling an image}. The mesh grid
-options are common to all the programs using it, and are listed in
address@hidden grid options}. In order to ignore some pixels during the
-analysis, you can specify a mask image, see @ref{Mask image} for an
-explanation and the relevant options. For a more accurate result, a
-kernel file name can be specified so the image is first convolved, see
address@hidden signal in a mesh}, see @ref{Convolution kernel} for
-the kernel related options. The @option{--kernel} option is not
+currently has to be only a 2D image. But in the future it might be useful
+to use it for 1D or 3D data too. Any pixels in the image with a blank value
+will be ignored in the analysis, see @ref{Blank pixels}. The common options
+to all Gnuastro programs can be seen in @ref{Common options} and input data
+formats are explained in @ref{Arguments}.
+
+SubtractSky uses a mesh grid to tile the image. This enables it to deal
+with possible gradients, see @ref{Tiling an image}. The mesh grid options
+are common to all the programs using it, and are listed in @ref{Mesh grid
+options}. In order to ignore some pixels during the analysis, you can use
+Gnuastro's @ref{Arithmetic} program to give those pixels a blank value
+before feeding them into SubtractSky (see @ref{Blank pixels}). For a more
+accurate result, a kernel file name can be specified so the image is first
+convolved, see @ref{Quantifying signal in a mesh}, see @ref{Convolution
+kernel} for the kernel related options. The @option{--kernel} option is not
 mandatory and if not specified anywhere prior to running, the original
-image will be used. Please run SubtractSky with the @option{--help}
-option to list all the recognized options, irrespective of which part
-of the book they are fully explained in.
+image will be used. Please run SubtractSky with the @option{--help} option
+to list all the recognized options, irrespective of which part of the book
+they are fully explained in.
 
 @table @option
 
@@ -11139,7 +11068,6 @@ One line examples:
 @example
 $ astimgstat input.fits
 $ astimgstat animage.fits --ignoremin --nohist
-$ astimgstat anotherimage.fits --mask=detectionlabels.fits --mhdu=1
 @end example
 
 @noindent
@@ -11162,8 +11090,7 @@ frequency plots. If no value is given for these options 
when
 ImageStatistics is about to start processing the data, then the full
 data range will be used. Such that the minimum image value will be set
 for the minimums and the maximum image value will be used for the
-maximum. The Mask name and HDU are also not mandatory in the
-configuration file.
+maximum.
 
 @cindex ASCII plot
 By default, in verbose mode @footnote{If the @option{-q} option is not
@@ -11220,21 +11147,11 @@ ImageStatistics finished in:  0.006964 (seconds)
 
 @table @option
 
address@hidden -M STR
address@hidden --mask=STR
-The file name of a mask image. If this option is not given on the
-command-line or in the configuration files and @option{--mhdu} is not given
-or is identical to @option{--hdu}, then no mask image will be used.
-
address@hidden -H STR
address@hidden --mhdu=STR
-The header name of the mask extension.
-
 @item -r
 @itemx --ignoremin
-Ignore all data elements that have a value equal to the minimum value
-in the image. In practice this is like masking those pixels, their
-values will not be used.
+Ignore all data elements that have a value equal to the minimum value in
+the image. In practice this is like setting them as @ref{Blank pixels},
+their values will not be used.
 
 @item -l
 @itemx --lowerbin
@@ -11483,18 +11400,16 @@ One line examples:
 @example
 $ astnoisechisel input.fits
 $ astnoisechisel --nch1=4 --lmesh=256 input.fits
-$ astnoisechisel field.fits --mask=badpixels.fits --mhdu=1
 @end example
 
 @cindex Gaussian
 @noindent
-If NoiseChisel is to do processing, an input image should be provided
-with the recognized extensions as input data, see @ref{Arguments}.
-The options that are shared by all Gnuastro programs can be seen in
address@hidden options}. In order to ignore some pixels during the
-analysis, you can specify a mask image, see @ref{Mask image} for an
-explanation and the relevant options. A masked pixel is completely
-ignored.
+If NoiseChisel is to do processing, an input image should be provided with
+the recognized extensions as input data, see @ref{Arguments}.  The options
+that are shared by all Gnuastro programs can be seen in @ref{Common
+options}. In order to ignore some pixels during the analysis, you can use
+Gnuastro's @ref{Arithmetic} program to set them as blank (see @ref{Blank
+pixels}). Any blank pixel is ignored by all the steps of NoiseChisel.
 
 A convolution kernel can also be optionally given. If a value (file
 name) is given to @option{--kernel} on the command-line or in a
@@ -11999,11 +11914,6 @@ All the inputs to MakeCatalog (see @ref{MakeCatalog}) 
are included in
 this one file which makes the running of MakeCatalog after NoiseChisel
 very easy.
 
address@hidden
-All masked pixels given to NoiseChisel will have a value of NaN in
-this image. So if you decide to run MakeCatalog after NoiseChisel,
-there is no more need to feed the mask image to MakeCatalog too.
-
 @end itemize
 
 @item
@@ -12465,14 +12375,11 @@ $ astmkcatalog --objlabs=K_labeled.fits --objhdu=1 \
 
 @cindex Gaussian
 @noindent
-If MakeCatalog is to do processing, an input image should be provided
-with the recognized extensions as input data, see
address@hidden Optionally a mask file can be specified to ignore
-some of the pixels in the image, see @ref{Mask image}. Note that if
-you generated the labeled image using NoiseChisel with a mask image as
-input, there is no more need to inform MakeCatalog of the mask image,
-see @ref{NoiseChisel output}. The options common to all Gnuastro
-programs are explained in @ref{Common options}.
+If MakeCatalog is to do processing, an input image should be provided with
+the recognized extensions as input data, see @ref{Arguments}. Optionally a
+mask file can be specified to ignore some of the pixels in the image. The
+options common to all Gnuastro programs are explained in @ref{Common
+options}.
 
 MakeCatalog needs 4 (or 5) images as input. These images can be separate
 extensions in one file (NoiseChisel's default output), or each can have its
@@ -12511,13 +12418,11 @@ MakeCatalog will use the input name, see 
@ref{Automatic output}. When only
 building an object catalog, any suffix in the value to output will just be
 replaced with @file{.txt}.
 
-The first set of options specify the properties of the inputs. Other
-necessary input images are treated very much like a mask image, see
address@hidden image}. If no name is specified for them, their HDU is
-checked and if that differs from the input HDU, then there is no need
-to specify a file name for them. The object and column label images or
-segmentation maps should not be of a floating point type
-(@code{BITPIX}).
+The first set of options specify the properties of the inputs. If no name
+is specified for the other necessary input images, their HDU is checked and
+if that differs from the input HDU, then there is no need to specify a file
+name for them. The object and column label images or segmentation maps
+should not be of a floating point type (@code{BITPIX}).
 
 @table @option
 
diff --git a/lib/checkset.c b/lib/checkset.c
index 02d3e68..ad9ab0e 100644
--- a/lib/checkset.c
+++ b/lib/checkset.c
@@ -805,9 +805,9 @@ gal_checkset_dir_0_file_1(char *name, int dontdelete)
 /* Allocate space and write the output name (outname) based on a given
    input name (inname). The suffix of the input name (if present) will
    be removed and the given suffix will be put in the end. */
-void
-gal_checkset_automatic_output(char *inname, char *suffix, int removedirinfo,
-                              int dontdelete, char **outname)
+char *
+gal_checkset_automatic_output(struct gal_options_common_params *cp,
+                              char *inname, char *suffix)
 {
   char *out;
   size_t i, l, offset=0;
@@ -858,11 +858,9 @@ gal_checkset_automatic_output(char *inname, char *suffix, 
int removedirinfo,
         }
     }
 
-  /* If it is desired to remove the directory information from the
-     name, do it here. Some unused space will remain after removing
-     the directory information, but that can be ignored, since it
-     can't be too much. */
-  if(removedirinfo)
+  /* If we don't want the input directory information, remove them
+     here. */
+  if(!cp->keepinputdir)
     {
       l=strlen(out);
       for(i=l;i!=0;--i)         /* Find the last forward slash.      */
@@ -874,11 +872,10 @@ gal_checkset_automatic_output(char *inname, char *suffix, 
int removedirinfo,
     }
 
   /* Remove the created filename if it already exits. */
-  gal_checkset_check_remove_file(out, dontdelete);
+  gal_checkset_check_remove_file(out, cp->dontdelete);
 
-  /* Free the outname if it was already allocated before. */
-  free(*outname);
-  *outname=out;
+  /* Return the resulting filename. */
+  return out;
 }
 
 
diff --git a/lib/checkset.h b/lib/checkset.h
index 3930e16..218ef90 100644
--- a/lib/checkset.h
+++ b/lib/checkset.h
@@ -27,7 +27,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
    must be included before the C++ preparations below */
 #include <math.h>
 #include <fitsio.h>
-
+#include <options.h>
 
 /* C++ Preparations */
 #undef __BEGIN_C_DECLS
@@ -219,10 +219,9 @@ gal_checkset_check_remove_file(char *filename, int 
dontdelete);
 int
 gal_checkset_dir_0_file_1(char *name, int dontdelete);
 
-void
-gal_checkset_automatic_output(char *inname, char *suffix,
-                              int removedirinfo, int dontdelete,
-                              char **outname);
+char *
+gal_checkset_automatic_output(struct gal_options_common_params *cp,
+                              char *inname, char *suffix);
 
 char *
 gal_checkset_dir_part(char *input);
diff --git a/lib/fits.c b/lib/fits.c
index 676a7f3..8f1fd82 100644
--- a/lib/fits.c
+++ b/lib/fits.c
@@ -1242,17 +1242,16 @@ gal_fits_read_wcs(char *filename, char *hdu, size_t 
hstartwcs,
    function. The value that is placed for those pixels is defined by
    the macros in fitsarrayvv.h and depends on the type of the data.*/
 gal_data_t *
-gal_fits_read_img_hdu(char *filename, char *hdu, char *maskname,
-                      char *mhdu, size_t minmapsize)
+gal_fits_read_img_hdu(char *filename, char *hdu, size_t minmapsize)
 {
   void *blank;
   int anyblank;
   size_t i, ndim;
   fitsfile *fptr;
   int status=0, type;
+  gal_data_t *img, *keysll=NULL;
   long *fpixel, *dsize, dsize_key=1;
   char **str, *name=NULL, *unit=NULL;
-  gal_data_t *img, *mask, *keysll=NULL;
 
 
   /* Check HDU for realistic conditions: */
@@ -1317,20 +1316,6 @@ gal_fits_read_img_hdu(char *filename, char *hdu, char 
*maskname,
   gal_fits_io_error(status, NULL);
 
 
-  /* If a mask was specified, read it into the mask data structure, then
-     set all the corresponding pixels of the input image to NaN. */
-  if(maskname)
-    {
-      /* Read the mask HDU. */
-      mask=gal_fits_read_img_hdu(maskname, mhdu, NULL, NULL, minmapsize);
-
-      /* Apply the mask on the input. */
-      gal_data_apply_mask(img, mask);
-
-      /* Free the mask space. */
-      gal_data_free(mask, 0);
-    }
-
   /* Return the filled data structure */
   return img;
 }
@@ -1339,21 +1324,17 @@ gal_fits_read_img_hdu(char *filename, char *hdu, char 
*maskname,
 
 
 
-/* The user has specified an input file and a mask file. In the
-   processing, all masked pixels will be converted to NaN pixels in
-   the input image so we only have to deal with one array. Also since
-   all processing is done on floating point arrays, the input is
-   converted to floating point, irrespective of its input type. The
-   original input bitpix will be stored so if you want to, you can
-   return it back to the input type if you please. */
+/* The user has specified an input file + extension, and your program needs
+   this input to be a special type. For such cases, this function can be
+   used to convert the input file to the desired type. */
 gal_data_t *
-gal_fits_read_to_type(char *inputname, char *inhdu, char *maskname,
-                      char *mhdu, int type, size_t minmapsize)
+gal_fits_read_to_type(char *inputname, char *hdu, int type,
+                      size_t minmapsize)
 {
   gal_data_t *in, *converted;
 
   /* Read the specified input image HDU. */
-  in=gal_fits_read_img_hdu(inputname, inhdu, maskname, mhdu, minmapsize);
+  in=gal_fits_read_img_hdu(inputname, hdu, minmapsize);
 
   /* If the input had another type, convert it to float. */
   if(in->type!=type)
@@ -1372,8 +1353,7 @@ gal_fits_read_to_type(char *inputname, char *inhdu, char 
*maskname,
 
 
 gal_data_t *
-gal_fits_read_float_kernel(char *inputname, char *inhdu, float **outkernel,
-                           size_t *ins0, size_t *ins1)
+gal_fits_read_float_kernel(char *filename, char *hdu, size_t minmapsize)
 {
   size_t i;
   int check=0;
@@ -1382,8 +1362,8 @@ gal_fits_read_float_kernel(char *inputname, char *inhdu, 
float **outkernel,
   float *f, *fp, tmp;
 
   /* Read the image as a float */
-  kernel=gal_fits_read_to_type(inputname, inhdu, NULL, NULL,
-                               GAL_DATA_TYPE_FLOAT, -1);
+  kernel=gal_fits_read_to_type(filename, hdu, GAL_DATA_TYPE_FLOAT,
+                               minmapsize);
 
   /* Check if the size along each dimension of the kernel is an odd
      number. If they are all an odd number, then the for each dimension,
@@ -1394,10 +1374,10 @@ gal_fits_read_float_kernel(char *inputname, char 
*inhdu, float **outkernel,
     error(EXIT_FAILURE, 0, "the kernel image has to have an odd number "
           "of pixels in all dimensions (there has to be one element/pixel "
           "in the center). At least one of the dimensions of %s (hdu: %s) "
-          "doesn't have an odd number of pixels", inputname, inhdu);
+          "doesn't have an odd number of pixels", filename, hdu);
 
-  /* If there are any NaN pixels, set them to zero and normalize it. There
-     are no blank pixels any more.*/
+  /* If there are any NaN pixels, set them to zero and normalize it. A
+     blank pixel in a kernel is going to make a completely blank output.*/
   fp=(f=kernel->array)+kernel->size;
   do
     {
diff --git a/lib/gnuastro/fits.h b/lib/gnuastro/fits.h
index 1bc3f93..8fb9370 100644
--- a/lib/gnuastro/fits.h
+++ b/lib/gnuastro/fits.h
@@ -217,16 +217,14 @@ gal_fits_read_wcs(char *filename, char *hdu, size_t 
hstartwcs,
  ******************     Array functions      *****************
  *************************************************************/
 gal_data_t *
-gal_fits_read_img_hdu(char *filename, char *hdu, char *maskname,
-                      char *mhdu, size_t minmapsize);
+gal_fits_read_img_hdu(char *filename, char *hdu, size_t minmapsize);
 
 gal_data_t *
-gal_fits_read_to_type(char *inputname, char *inhdu, char *maskname,
-                      char *mhdu, int type, size_t minmapsize);
+gal_fits_read_to_type(char *inputname, char *inhdu, int type,
+                      size_t minmapsize);
 
 gal_data_t *
-gal_fits_read_float_kernel(char *inputname, char *inhdu, float **outkernel,
-                           size_t *ins0, size_t *ins1);
+gal_fits_read_float_kernel(char *filename, char *hdu, size_t minmapsize);
 
 fitsfile *
 gal_fits_write_img_fitsptr(gal_data_t *data, char *filename, char *extname);
diff --git a/lib/options.h b/lib/options.h
index 21f813f..26b4b40 100644
--- a/lib/options.h
+++ b/lib/options.h
@@ -79,22 +79,22 @@ enum options_option_keys
 struct gal_options_common_params
 {
   /* Input/Output: */
-  char          *hdu;          /* Image extension.                       */
-  char       *output;          /* Directory containg output.             */
-  int     dontdelete;          /* ==1: Don't delete existing file.       */
-  int   keepinputdir;          /* Keep input directory for auto output.  */
+  char                    *hdu; /* Image extension.                      */
+  char                 *output; /* Directory containg output.            */
+  int               dontdelete; /* ==1: Don't delete existing file.      */
+  int             keepinputdir; /* Keep input directory for auto output. */
 
   /* Operating modes: */
-  int          quiet;          /* Only print errors.                     */
-  size_t  numthreads;          /* Number of threads to use.              */
-  size_t  minmapsize;          /* Minimum bytes necessary to use mmap.   */
-  int            log;          /* Make a log file.                       */
+  int                    quiet; /* Only print errors.                    */
+  size_t            numthreads; /* Number of threads to use.             */
+  size_t            minmapsize; /* Minimum bytes necessary to use mmap.  */
+  int                      log; /* Make a log file.                      */
 
   /* For internal purposes. */
-  char *program_name;           /* Official name to be used in text.     */
-  char *program_exec;           /* Program's executable name.            */
-  char *program_bibtex;         /* BibTeX record for this program.       */
-  char *program_authors;        /* List of the program authors.          */
+  char           *program_name; /* Official name to be used in text.     */
+  char           *program_exec; /* Program's executable name.            */
+  char         *program_bibtex; /* BibTeX record for this program.       */
+  char        *program_authors; /* List of the program authors.          */
   struct argp_option *coptions; /* Common options to all programs.       */
   struct argp_option *poptions; /* Program specific options.             */
 };
diff --git a/tmpfs-config-make b/tmpfs-config-make
index efebdc0..219fca8 100755
--- a/tmpfs-config-make
+++ b/tmpfs-config-make
@@ -131,7 +131,7 @@ cd $build_dir
 # ####################################
 if [ ! -f Makefile ]; then
     $srcdir/configure --srcdir=$srcdir --disable-shared CFLAGS="-g -O0"\
-                      --enable-table
+                      --enable-table --enable-arithmetic
 fi
 
 



reply via email to

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