gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] (no subject)


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] (no subject)
Date: Sun, 29 May 2016 11:47:49 +0000 (UTC)

branch: master
commit cfe8a26ca1d61304511c2f279d338302bbd5b755
Author: Mosè Giordano <address@hidden>
Date:   Sat Nov 7 15:48:14 2015 +0100

    Rename exported macros to follow new naming conventions
    
    Addresses task#13765.  Following GSL example, header’s macros are named
    __GAL_XXX__.
---
 include/arraymanip.h           |    4 +-
 include/astrthreads.h          |    6 +--
 include/box.h                  |    4 +-
 include/checkset.h             |   10 ++--
 include/commonargs.h           |    4 +-
 include/commonparams.h         |    4 +-
 include/configfiles.h          |   30 ++++++------
 include/fitsarrayvv.h          |   16 +++----
 include/fixedstringmacros.h    |   22 ++++-----
 include/forqsort.h             |    4 +-
 include/linkedlist.h           |    4 +-
 include/mesh.h                 |   12 ++---
 include/mode.h                 |   20 ++++----
 include/neighbors.h            |   14 +++---
 include/polygon.h              |   34 ++++++-------
 include/spatialconvolve.h      |    4 +-
 include/statistics.h           |    6 +--
 include/timing.h               |   12 ++---
 include/txtarrayvv.h           |   10 ++--
 lib/astrthreads.c              |    4 +-
 lib/fitsarrayvv.c              |  104 ++++++++++++++++++++++++----------------
 lib/mesh.c                     |   22 ++++-----
 lib/mode.c                     |   46 +++++++++---------
 lib/polygon.c                  |   46 +++++++++---------
 lib/spatialconvolve.c          |    4 +-
 lib/statistics.c               |    2 +-
 lib/timing.c                   |    5 +-
 lib/txtarrayvv.c               |   16 +++----
 src/convertt/args.h            |    6 +--
 src/convertt/cite.h            |    2 +-
 src/convertt/ui.c              |   44 ++++++++---------
 src/convolve/args.h            |    6 +--
 src/convolve/cite.h            |    2 +-
 src/convolve/convolve.c        |    6 +--
 src/convolve/ui.c              |   42 ++++++++--------
 src/header/args.h              |    6 +--
 src/header/cite.h              |    2 +-
 src/header/ui.c                |   16 +++----
 src/imgcrop/args.h             |    6 +--
 src/imgcrop/cite.h             |    2 +-
 src/imgcrop/crop.c             |    2 +-
 src/imgcrop/imgcrop.c          |   10 ++--
 src/imgcrop/ui.c               |   46 +++++++++---------
 src/imgstat/args.h             |    6 +--
 src/imgstat/cite.h             |    2 +-
 src/imgstat/imgstat.c          |    2 +-
 src/imgstat/ui.c               |   48 +++++++++----------
 src/imgwarp/args.h             |    6 +--
 src/imgwarp/cite.h             |    2 +-
 src/imgwarp/imgwarp.c          |   14 +++---
 src/imgwarp/ui.c               |   26 +++++-----
 src/mkcatalog/args.h           |    6 +--
 src/mkcatalog/cite.h           |    2 +-
 src/mkcatalog/mkcatalog.c      |   10 ++--
 src/mkcatalog/ui.c             |   62 ++++++++++++------------
 src/mknoise/args.h             |    6 +--
 src/mknoise/cite.h             |    2 +-
 src/mknoise/ui.c               |   24 +++++-----
 src/mkprof/args.h              |    6 +--
 src/mkprof/cite.h              |    2 +-
 src/mkprof/mkprof.c            |    6 +--
 src/mkprof/oneprofile.c        |    4 +-
 src/mkprof/ui.c                |   80 +++++++++++++++----------------
 src/noisechisel/args.h         |    6 +--
 src/noisechisel/binary.c       |    9 ++--
 src/noisechisel/binary.h       |    2 +-
 src/noisechisel/cite.h         |    2 +-
 src/noisechisel/clumps.c       |   14 +++---
 src/noisechisel/detection.c    |   18 +++----
 src/noisechisel/label.c        |    7 +--
 src/noisechisel/label.h        |    6 +--
 src/noisechisel/noisechisel.c  |    2 +-
 src/noisechisel/segmentation.c |   17 ++++---
 src/noisechisel/sky.c          |    2 +-
 src/noisechisel/thresh.c       |    6 +--
 src/noisechisel/ui.c           |   92 +++++++++++++++++------------------
 src/subtractsky/args.h         |    6 +--
 src/subtractsky/cite.h         |    2 +-
 src/subtractsky/subtractsky.c  |    4 +-
 src/subtractsky/ui.c           |   48 +++++++++----------
 80 files changed, 630 insertions(+), 596 deletions(-)

diff --git a/include/arraymanip.h b/include/arraymanip.h
index ab00bff..48d472b 100644
--- a/include/arraymanip.h
+++ b/include/arraymanip.h
@@ -20,8 +20,8 @@ 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 ARRAYMANIP_H
-#define ARRAYMANIP_H
+#ifndef __GAL_ARRAYMANIP_H__
+#define __GAL_ARRAYMANIP_H__
 
 void
 gal_arraymanip_uchar_init_on_region(unsigned char *in, const unsigned char v,
diff --git a/include/astrthreads.h b/include/astrthreads.h
index 9a1601b..d0b276b 100644
--- a/include/astrthreads.h
+++ b/include/astrthreads.h
@@ -20,8 +20,8 @@ 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 ASTRTHREADS_H
-#define ASTRTHREADS_H
+#ifndef __GAL_THREADS_H__
+#define __GAL_THREADS_H__
 
 
 
@@ -33,7 +33,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 
-#define NONTHRDINDEX (size_t)(-1)
+#define GAL_THREADS_NON_THRD_INDEX (size_t)(-1)
 
 
 
diff --git a/include/box.h b/include/box.h
index 2c6694f..6277fd7 100644
--- a/include/box.h
+++ b/include/box.h
@@ -20,8 +20,8 @@ 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 BOX_H
-#define BOX_H
+#ifndef __GAL_BOX_H__
+#define __GAL_BOX_H__
 
 /*                        IMPORTANT NOTE:
         All the axises are based on the FITS standard, NOT C.
diff --git a/include/checkset.h b/include/checkset.h
index 07881b7..cce1a51 100644
--- a/include/checkset.h
+++ b/include/checkset.h
@@ -20,8 +20,8 @@ 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 CHECKSET_H
-#define CHECKSET_H
+#ifndef __GAL_CHECKSET_H__
+#define __GAL_CHECKSET_H__
 
 #include <math.h>
 #include <fitsio.h>
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 /**************************************************************/
 /*********                 Macros                **************/
 /**************************************************************/
-#define CHECKCOLINCAT(INCOL,NAME) {                                    \
+#define GAL_CHECKSET_CHECK_COL_IN_CAT(INCOL,NAME) {                     \
     size_t i;                                                          \
                                                                        \
     if( (INCOL) >= p->cs1 )                                            \
@@ -43,12 +43,12 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
        error(EXIT_FAILURE, 0, "%s: Column %lu (--%s) in row %lu "      \
              "could not be read as a number. See %s. Note that "       \
              "counting starts from zero.",                             \
-             p->up.catname, (INCOL), (NAME), i, TXTARRAYVVLOG);        \
+             p->up.catname, (INCOL), (NAME), i, GAL_TXTARRAY_LOG);     \
   }
 
 
 
-#define PRINTSTINGMAYBEWITHSPACE(name,string) {                         \
+#define GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE(name,string) {       \
     if(gal_checkset_string_has_space(string))                           \
       fprintf(fp, CONF_SHOWFMT"\"%s\"\n", name, string);                \
     else                                                                \
diff --git a/include/commonargs.h b/include/commonargs.h
index f28dc69..f8c406d 100644
--- a/include/commonargs.h
+++ b/include/commonargs.h
@@ -20,8 +20,8 @@ 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 COMMONARGS_H
-#define COMMONARGS_H
+#ifndef __GAL_COMMONARGS_H__
+#define __GAL_COMMONARGS_H__
 
 #include <argp.h>
 #include <string.h>
diff --git a/include/commonparams.h b/include/commonparams.h
index 203f5c9..867c126 100644
--- a/include/commonparams.h
+++ b/include/commonparams.h
@@ -20,8 +20,8 @@ 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 COMMONPARAMS_H
-#define COMMONPARAMS_H
+#ifndef __GAL_COMMONPARAMS_H__
+#define __GAL_COMMONPARAMS_H__
 
 
 /* The structure keeping all the common parameters in gnuastro. This
diff --git a/include/configfiles.h b/include/configfiles.h
index f959dcf..fc7cf48 100644
--- a/include/configfiles.h
+++ b/include/configfiles.h
@@ -20,8 +20,8 @@ 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 CONFIGFILES_H
-#define CONFIGFILES_H
+#ifndef __GAL_CONFIGFILES_H__
+#define __GAL_CONFIGFILES_H__
 
 
 
@@ -29,11 +29,11 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 /************               Macros                *************/
 /**************************************************************/
 /* Simple macros: */
-#define CONFIG_DELIMITERS " ,=:\t\n"
+#define GAL_CONFIGFILES_DELIMITERS " ,=:\t\n"
 
 
 
-#define STARTREADINGLINE {                                             \
+#define GAL_CONFIGFILES_START_READING_LINE {                            \
   ++lineno;                                                            \
   if(*line=='#') continue;                                             \
   else gal_configfiles_read_name_value(line, filename, lineno,          \
@@ -46,7 +46,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 /* Functional macros: These are not actual functions, because they
    depend on functions that are different for different programs. So
    they have to be written into the functions with a macro. */
-#define SAVE_LOCAL_CONFIG(INDIR) {                                     \
+#define GAL_CONFIGFILES_SAVE_LOCAL_CONFIG(INDIR) {                      \
     FILE *fp;                                                          \
     char *outfilename, *command;                                       \
     fp=gal_configfiles_write_local_config_stop(INDIR, CONFIG_FILE,      \
@@ -70,12 +70,12 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 
-#define CHECKSETCONFIG {                                                \
+#define GAL_CONFIGFILES_CHECK_SET_CONFIG {                              \
     char *userconfig_dir, *userconfig_file;                            \
                                                                         \
     readconfig(CURDIRCONFIG_FILE, p);                                   \
     if(cp->setdirconf)                                                  \
-      SAVE_LOCAL_CONFIG(CURDIRCONFIG_DIR);                              \
+      GAL_CONFIGFILES_SAVE_LOCAL_CONFIG(CURDIRCONFIG_DIR);              \
     if(cp->onlyversionset && strcmp(cp->onlyversion, SPACK_VERSION))    \
       error(EXIT_FAILURE, 0, "The running version of %s is `%s'. "      \
             "However, you have asked for this %s run to be with "       \
@@ -98,7 +98,8 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
         userconfig_file=                                                \
           gal_configfiles_add_home_dir(USERCONFIG_FILEEND);             \
         readconfig(userconfig_file, p);                                 \
-        if(cp->setusrconf) SAVE_LOCAL_CONFIG(userconfig_dir);           \
+        if(cp->setusrconf)                                              \
+          GAL_CONFIGFILES_SAVE_LOCAL_CONFIG(userconfig_dir);            \
         readconfig(SYSCONFIG_FILE, p);                                  \
         free(userconfig_file);                                         \
         free(userconfig_dir);                                          \
@@ -111,7 +112,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 
-#define REPORT_NOTSET(var_name) {                                      \
+#define GAL_CONFIGFILES_REPORT_NOTSET(var_name) {                       \
     if(intro==0)                                                       \
       {                                                                        
\
        fprintf(stderr, SPACK": Parameter(s) not set: %s", (var_name)); \
@@ -125,7 +126,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 
-#define END_OF_NOTSET_REPORT {                                         \
+#define GAL_CONFIGFILES_END_OF_NOTSET_REPORT {                          \
     if(intro)                                                          \
       {                                                                        
\
        char *userconfig_file;                                          \
@@ -148,7 +149,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 
-#define REPORT_PARAMETERS_SET {                                                
\
+#define GAL_CONFIGFILES_REPORT_PARAMETERS_SET {                         \
     fprintf(stdout, "# "SPACK_STRING"\n");                             \
     fprintf(stdout, "# Configured on "CONFIGDATE" at "CONFIGTIME"\n"); \
     fprintf(stdout, "# Written on %s", ctime(&p->rawtime));            \
@@ -163,7 +164,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 /* Read the options that are common to all programs from the
    configuration file. Since these two checks are within an if-else
    structure, they should not be placed within an `{' and `}'. */
-#define READ_COMMONOPTIONS_FROM_CONF                                    \
+#define GAL_CONFIGFILES_READ_COMMONOPTIONS_FROM_CONF                    \
     else if(strcmp(name, "numthreads")==0)                              \
       {                                                                 \
         if(cp->numthreadsset) continue;                                 \
@@ -194,13 +195,14 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 /* Write common options: */
-#define PRINT_COMMONOPTIONS {                                           \
+#define GAL_CONFIGFILES_PRINT_COMMONOPTIONS {                           \
     if(cp->numthreadsset)                                               \
       fprintf(fp, CONF_SHOWFMT"%lu\n", "numthreads", p->cp.numthreads); \
     if(cp->nologset)                                                    \
       fprintf(fp, CONF_SHOWFMT"%d\n", "nolog", p->cp.nolog);            \
     if(cp->onlyversionset)                                              \
-      PRINTSTINGMAYBEWITHSPACE("onlyversion", cp->onlyversion);         \
+      GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("onlyversion",         \
+                                                 cp->onlyversion);      \
   }
 
 
diff --git a/include/fitsarrayvv.h b/include/fitsarrayvv.h
index 1635dde..59c511e 100644
--- a/include/fitsarrayvv.h
+++ b/include/fitsarrayvv.h
@@ -20,8 +20,8 @@ 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 FITSMATRIX_H
-#define FITSMATRIX_H
+#ifndef __GAL_FITSMATRIX_H__
+#define __GAL_FITSMATRIX_H__
 
 #include <math.h>
 #include <float.h>
@@ -32,12 +32,12 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <wcslib/wcsfix.h>
 #include <wcslib/wcs.h>
 
-#define FITSSTRINGBLANK   NULL
-#define FITSBYTEBLANK     UCHAR_MAX    /* 0 is often meaningful here! */
-#define FITSSHORTBLANK    INT16_MIN
-#define FITSLONGBLANK     INT32_MIN
-#define FITSLLONGBLANK    INT64_MIN
-#define FITSFLOATBLANK    NAN
+#define GAL_FITSARRAY_STRING_BLANK   NULL
+#define GAL_FITSARRAY_BYTE_BLANK     UCHAR_MAX /* 0 is often meaningful here! 
*/
+#define GAL_FITSARRAY_SHORT_BLANK    INT16_MIN
+#define GAL_FITSARRAY_LONG_BLANK     INT32_MIN
+#define GAL_FITSARRAY_LLONG_BLANK    INT64_MIN
+#define GAL_FITSARRAY_FLOAT_BLANK    NAN
 
 
 
diff --git a/include/fixedstringmacros.h b/include/fixedstringmacros.h
index cbbd319..99bdc77 100644
--- a/include/fixedstringmacros.h
+++ b/include/fixedstringmacros.h
@@ -20,31 +20,31 @@ 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 COPYRIGHT_H
-#define COPYRIGHT_H
+#ifndef __GAL_COPYRIGHT_H__
+#define __GAL_COPYRIGHT_H__
 
-#define SHORTCOPYRIGHT "Copyright (C) 2015, Free Software Foundation, Inc."
+#define GAL_STRINGS_SHORT_COPYRIGHT "Copyright (C) 2015, Free Software 
Foundation, Inc."
 
 
-#define SHORTLICENSE   "License GPLv3+: GNU General public license version 3 
or later."
+#define GAL_STRINGS_SHORT_LICENSE   "License GPLv3+: GNU General public 
license version 3 or later."
 
 
-#define COPYRIGHT SHORTCOPYRIGHT"\n"SHORTLICENSE"\n"                   \
+#define GAL_STRINGS_COPYRIGHT 
GAL_STRINGS_SHORT_COPYRIGHT"\n"GAL_STRINGS_SHORT_LICENSE"\n" \
   "This is free software: you are free to change and redistribute it.\n" \
   "There is NO WARRANTY, to the extent permitted by law."              \
 
 
-#define TOPHELPINFO   "\n"SPACK_NAME" is part of "PACKAGE_STRING".\n"
+#define GAL_STRINGS_TOP_HELP_INFO   "\n"SPACK_NAME" is part of 
"PACKAGE_STRING".\n"
 
 
 
 /* This is fixed for all the packages. */
-#define MOREHELPINFO   "\nFor more information, please run any of the "        
\
+#define GAL_STRINGS_MORE_HELP_INFO   "\nFor more information, please run any 
of the " \
   "following commands. They will respectively show you the `Invoking " \
   SPACK_NAME"' subsection, the complete `"SPACK_NAME"' section, or the "\
   "full "PACKAGE_NAME" manual. In particular the first contains "       \
-  "a very complete explanation of each option.\n\n"                       \
-  "     info "SPACK"\n\n"                                                 \
+  "a very complete explanation of each option.\n\n"                     \
+  "     info "SPACK"\n\n"                                               \
   "     info "SPACK_NAME"\n\n"                                         \
   "     info "PACKAGE_TARNAME"\n\n"                                     \
   "If you couldn't find your answer in the manual, you can get "        \
@@ -55,7 +55,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 
-#define GNUASTROBIBTEX                                                  \
+#define GAL_STRINGS_BIBTEX                                              \
   "@ARTICLE{noisechisel,\n"                                             \
   "   author = {{Akhlaghi}, M. and {Ichikawa}, T.},\n"                  \
   "    title = \"{Noise-based Detection and Segmentation of Nebulous 
Objects}\",\n" \
@@ -79,7 +79,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 /* This can be used in the end of error messages related to option
    values. */
-#define HOWTOCHECKVALUES                                                \
+#define GAL_STRINGS_HOW_TO_CHECK_VALUES                                 \
   " You can check all the input values with the `--printparams' "       \
   "(-P) option."
 
diff --git a/include/forqsort.h b/include/forqsort.h
index 3557f0b..a970cc6 100644
--- a/include/forqsort.h
+++ b/include/forqsort.h
@@ -20,8 +20,8 @@ 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 FORQSORT_H
-#define FORQSORT_H
+#ifndef __GAL_QSORT_H__
+#define __GAL_QSORT_H__
 
 /* Pointer used to sort the indexs of an array based on their flux
    (value in this array). */
diff --git a/include/linkedlist.h b/include/linkedlist.h
index 64a3e27..928ff52 100644
--- a/include/linkedlist.h
+++ b/include/linkedlist.h
@@ -20,8 +20,8 @@ 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 SLL_H
-#define SLL_H
+#ifndef __GAL_SLL_H__
+#define __GAL_SLL_H__
 
 
 
diff --git a/include/mesh.h b/include/mesh.h
index 2beb146..5d5486a 100644
--- a/include/mesh.h
+++ b/include/mesh.h
@@ -20,8 +20,8 @@ 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 MESHGRID_H
-#define MESHGRID_H
+#ifndef __GAL_MESH_H__
+#define __GAL_MESH_H__
 
 
 
@@ -36,13 +36,13 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 /* Operations to do on each mesh. If input parameters are needed (for
    example the quantile), they are given as other argument(s) to the
    fillcharray function. */
-#define MAXNUMCHARRAY    2  /* Maximum number of charrays.                */
-#define INTERPALL        1  /* Interpolate over the whole image as one.   */
-#define INTERPCHANNEL    2  /* Interpolate over each channel individually.*/
+#define GAL_MESH_MAX_NUM_CHARRAY  2 /* Maximum number of charrays.             
   */
+#define GAL_MESH_INTERP_ALL       1 /* Interpolate over the whole image as 
one.   */
+#define GAL_MESH_INTERP_CHANNEL   2 /* Interpolate over each channel 
individually.*/
 
 
 /* The minimum number of acceptable nearest pixels. */
-#define MINACCEPTABLENEAREST 3
+#define GAL_MESH_MIN_ACCEPTABLE_NEAREST 3
 
 
 
diff --git a/include/mode.h b/include/mode.h
index fd8041e..61034f6 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -20,21 +20,21 @@ 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 MODE_H
-#define MODE_H
+#ifndef __GAL_MODE_H__
+#define __GAL_MODE_H__
 
-#define MODELOWQUANTILE  0.01f
-#define MODEHIGHQUANTILE 0.51f
+#define GAL_MODE_LOW_QUANTILE  0.01f
+#define GAL_MODE_HIGH_QUANTILE 0.51f
 
-#define MODESYMGOOD       0.2f
-#define MODELOWQUANTGOOD  0.02f
+#define GAL_MODE_SYM_GOOD        0.2f
+#define GAL_MODE_LOW_QUANT_GOOD  0.02f
 
-#define SYMMETRICITYLOWQUANT 0.01f
+#define GAL_MODE_SYMMETRICITY_LOW_QUANT 0.01f
 
-#define GOLDENRATIO        1.618034f
-#define TWOTAKEGOLDENRATIO 0.38197f
+#define GAL_MODE_GOLDEN_RATIO          1.618034f
+#define GAL_MODE_TWO_TAKE_GOLDEN_RATIO 0.38197f
 
-#define MIRRORISABOVERESULT    (size_t)(-1)
+#define GAL_MODE_MIRROR_IS_ABOVE_RESULT    (size_t)(-1)
 
 struct modeparams
 {
diff --git a/include/neighbors.h b/include/neighbors.h
index 483b94e..e967297 100644
--- a/include/neighbors.h
+++ b/include/neighbors.h
@@ -20,8 +20,8 @@ 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 NEIGHBORS_H
-#define NEIGHBORS_H
+#ifndef __GAL_NEIGHBORS_H__
+#define __GAL_NEIGHBORS_H__
 
 
 /* These macros can be put any where you want to know the neighbors of
@@ -39,7 +39,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
    *ngb       : Array keeping the neighbours indexs (allocated outside).
 */
 
-#define FILL_NGB_4_REGION {                                       \
+#define GAL_NEIGHBORS_FILL_4_REGION {                              \
     numngb=0;                                                     \
     if (*ind/is1!=x0  ) ngb[numngb++]=*ind-is1;                           \
     if (*ind/is1!=x1-1) ngb[numngb++]=*ind+is1;                           \
@@ -48,7 +48,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
   }
 
 
-#define FILL_NGB_4_ALLIMG {                                       \
+#define GAL_NEIGHBORS_FILL_4_ALLIMG {                              \
     numngb=0;                                                     \
     if (*ind/is1!=0    ) ngb[numngb++]=*ind-is1;                  \
     if (*ind/is1!=is0-1) ngb[numngb++]=*ind+is1;                  \
@@ -57,7 +57,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
   }
 
 
-#define FILL_NGB_8_REGION {                                       \
+#define GAL_NEIGHBORS_FILL_8_REGION {                              \
     unsigned char bl=0, br=0, tl=0, tr=0;                         \
     numngb=0;                                                     \
     if (*ind/is1!=x0  ) {ngb[numngb++]=*ind-is1; ++bl; ++br;}     \
@@ -80,7 +80,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
   }
 
 
-#define FILL_NGB_8_ALLIMG {                                       \
+#define GAL_NEIGHBORS_FILL_8_ALLIMG {                              \
     unsigned char bl=0, br=0, tl=0, tr=0;                         \
     numngb=0;                                                     \
     if (*ind/is1!=0     ) {ngb[numngb++]=*ind-is1; ++bl; ++br;}           \
@@ -103,7 +103,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
   }
 
 
-#define FILL_NGB_8_ALLIMG_IJ {                                    \
+#define GAL_NEIGHBORS_FILL_8_ALLIMG_IJ {                           \
     unsigned char bl=0, br=0, tl=0, tr=0;                         \
     numngb=0;                                                     \
     if (i!=0     ) {ngb[numngb++]=(i-1)*is1+j; ++bl; ++br;}       \
diff --git a/include/polygon.h b/include/polygon.h
index 4feb81f..99a03a6 100644
--- a/include/polygon.h
+++ b/include/polygon.h
@@ -20,15 +20,15 @@ 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 POLYGON_H
-#define POLYGON_H
+#ifndef __GAL_POLYGON_H__
+#define __GAL_POLYGON_H__
 
 
 
 
 
-#define MAXPOLYGONCORNERS 50
-#define ROUNDERR          1e-5
+#define GAL_POLYGON_MAX_CORNERS  50
+#define GAL_POLYGON_ROUND_ERR    1e-5
 
 
 
@@ -74,14 +74,14 @@ gal_polygon_clip(double *s, size_t n, double *c, size_t m,
 /**************            MACROS             ******************/
 /***************************************************************/
 /* The cross product of two points from the center. */
-#define crossproduct(A, B) ( (A)[0]*(B)[1] - (B)[0]*(A)[1] )
+#define GAL_POLYGON_CROSS_PRODUCT(A, B) ( (A)[0]*(B)[1] - (B)[0]*(A)[1] )
 
 
 
 
 /* Find the cross product (2*area) between three points. Each point is
    assumed to be a pointer that has atleast two values within it. */
-#define tricrossproduct(A, B, C)                  \
+#define GAL_POLYGON_TRI_CROSS_PRODUCT(A, B, C)    \
   ( ( (B)[0]-(A)[0] ) * ( (C)[1]-(A)[1] ) -       \
     ( (C)[0]-(A)[0] ) * ( (B)[1]-(A)[1] ) )       \
 
@@ -102,28 +102,28 @@ gal_polygon_clip(double *s, size_t n, double *c, size_t m,
    zero for the area. Zero would indicate that they are on the same
    line in this case this should give a true result.
 */
-#define pleftofline(A, B, C)                            \
-  ( tricrossproduct((A), (B), (C)) > -ROUNDERR ) /* >= 0 */
+#define GAL_POLYGON_LEFT_OF_LINE(A, B, C)                               \
+  ( GAL_POLYGON_TRI_CROSS_PRODUCT((A), (B), (C)) > -GAL_POLYGON_ROUND_ERR ) /* 
>= 0 */
 
 
 
 
-/* See if the three points are collinear, similar to pleftofline
+/* See if the three points are collinear, similar to GAL_POLYGON_LEFT_OF_LINE
    except that the result has to be exactly zero. */
-#define pcollinearwithline(A, B, C)                            \
-  ( tricrossproduct((A), (B), (C)) > -ROUNDERR                 \
-    && tricrossproduct((A), (B), (C)) < ROUNDERR) /* == 0 */
+#define GAL_POLYGON_COLLINEAR_WITH_LINE(A, B, C)                        \
+  (GAL_POLYGON_TRI_CROSS_PRODUCT((A), (B), (C)) > -GAL_POLYGON_ROUND_ERR \
+   && GAL_POLYGON_TRI_CROSS_PRODUCT((A), (B), (C)) < GAL_POLYGON_ROUND_ERR) /* 
== 0 */
 
 
 
 
-/* Similar to pleftofline except that if they are on the same line,
+/* Similar to GAL_POLYGON_LEFT_OF_LINE except that if they are on the same 
line,
    this will return 0 (so that it is not on the left). Therefore the
    name is "proper left". */
-#define ppropleftofline(A, B, C)                            \
-  ( tricrossproduct((A), (B), (C)) > ROUNDERR ) /* > 0   */
+#define GAL_POLYGON_PROP_LEFT_OF_LINE(A, B, C)                          \
+  ( GAL_POLYGON_TRI_CROSS_PRODUCT((A), (B), (C)) > GAL_POLYGON_ROUND_ERR ) /* 
> 0   */
 
 
-#define minoftwo(A, B) ( (A)<(B)+ROUNDERR ? (A) : (B) )
-#define maxoftwo(A, B) ( (A)>(B)-ROUNDERR ? (A) : (B) )
+#define GAL_POLYGON_MIN_OF_TWO(A, B) ((A)<(B)+GAL_POLYGON_ROUND_ERR ? (A) : 
(B))
+#define GAL_POLYGON_MAX_OF_TWO(A, B) ((A)>(B)-GAL_POLYGON_ROUND_ERR ? (A) : 
(B))
 #endif
diff --git a/include/spatialconvolve.h b/include/spatialconvolve.h
index 1a84791..2f85985 100644
--- a/include/spatialconvolve.h
+++ b/include/spatialconvolve.h
@@ -20,8 +20,8 @@ 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 SPATIALCONVOLVE_H
-#define SPATIALCONVOLVE_H
+#ifndef __GAL_SPATIALCONVOLVE_H__
+#define __GAL_SPATIALCONVOLVE_H__
 
 
 
diff --git a/include/statistics.h b/include/statistics.h
index 43fcd50..b364301 100644
--- a/include/statistics.h
+++ b/include/statistics.h
@@ -20,11 +20,11 @@ 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 STATISTICS_H
-#define STATISTICS_H
+#ifndef __GAL_STATISTICS_H__
+#define __GAL_STATISTICS_H__
 
 
-#define MAXSIGCLIPCONVERGE 50
+#define GAL_STATISTICS_MAX_SIG_CLIP_CONVERGE 50
 
 
 /****************************************************************
diff --git a/include/timing.h b/include/timing.h
index 49d326e..58c9474 100644
--- a/include/timing.h
+++ b/include/timing.h
@@ -20,16 +20,16 @@ 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 TIMING_H
-#define TIMING_H
+#ifndef __GAL_TIMING_H__
+#define __GAL_TIMING_H__
 
 #include <time.h>
 #include <sys/time.h>
 
-#define VERBMSGLENGTH_V 45
-#define VERBMSGLENGTH_T "45"
-#define VERBMSGLENGTHS2_V 65
-#define VERBMSGLENGTHS2_T "65"
+#define GAL_TIMING_VERB_MSG_LENGTH_V     45
+#define GAL_TIMING_VERB_MSG_LENGTH_T    "45"
+#define GAL_TIMING_VERB_MSG_LENGTHS_2_V  65
+#define GAL_TIMING_VERB_MSG_LENGTHS_2_T "65"
 
 unsigned long int
 gal_timing_time_based_rng_seed();
diff --git a/include/txtarrayvv.h b/include/txtarrayvv.h
index 19167bd..edf7c2a 100644
--- a/include/txtarrayvv.h
+++ b/include/txtarrayvv.h
@@ -20,8 +20,8 @@ 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 TXTARRAYVV_H
-#define TXTARRAYVV_H
+#ifndef __GAL_TXTARRAY_H__
+#define __GAL_TXTARRAY_H__
 
 #include <float.h>
 
@@ -31,9 +31,9 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 /* Simple macros: */
-#define FMTLENGTH     50
-#define DELIMITERS    " ,\t\n"
-#define TXTARRAYVVLOG "txtarrayvv.log"
+#define GAL_TXTARRAY_FMT_LENGTH     50
+#define GAL_TXTARRAY_DELIMITERS    " ,\t\n"
+#define GAL_TXTARRAY_LOG "txtarray.log"
 
 
 
diff --git a/lib/astrthreads.c b/lib/astrthreads.c
index 8e4f5c9..3f62c6b 100644
--- a/lib/astrthreads.c
+++ b/lib/astrthreads.c
@@ -156,7 +156,7 @@ gal_threads_dist_in_threads(size_t nindexs, size_t nthrds, 
size_t **outthrds,
 
   /* Initialize all the elements to NONINDEX. */
   fp=(sp=thrds)+nthrds*thrdcols;
-  do *sp=NONTHRDINDEX; while(++sp<fp);
+  do *sp=GAL_THREADS_NON_THRD_INDEX; while(++sp<fp);
 
   /* Distribute the labels in the threads.  */
   for(i=0;i<nindexs;++i)
@@ -168,7 +168,7 @@ gal_threads_dist_in_threads(size_t nindexs, size_t nthrds, 
size_t **outthrds,
       size_t j;
       printf("\n\n############################\n");
       printf("THREAD %lu: \n", i);
-      for(j=0;thrds[i*thrdcols+j]!=NONTHRDINDEX;j++)
+      for(j=0;thrds[i*thrdcols+j]!=GAL_THREADS_NON_THRD_INDEX;j++)
        printf("%lu, ", thrds[i*thrdcols+j]);
       printf("\b\b.\n");
     }
diff --git a/lib/fitsarrayvv.c b/lib/fitsarrayvv.c
index 2206820..c55c677 100644
--- a/lib/fitsarrayvv.c
+++ b/lib/fitsarrayvv.c
@@ -196,42 +196,42 @@ gal_fitsarray_bitpix_blank(int bitpix)
       b=malloc(sizeof(unsigned char));
       if(b==NULL)
        error(EXIT_FAILURE, errno, "%lu bytes", sizeof(unsigned char));
-      *b=FITSBYTEBLANK;
+      *b=GAL_FITSARRAY_BYTE_BLANK;
       return b;
 
     case SHORT_IMG:
       s=malloc(sizeof(short));
       if(s==NULL)
        error(EXIT_FAILURE, errno, "%lu bytes", sizeof(short));
-      *s=FITSSHORTBLANK;
+      *s=GAL_FITSARRAY_SHORT_BLANK;
       return s;
 
     case LONG_IMG:
       l=malloc(sizeof(long));
       if(l==NULL)
        error(EXIT_FAILURE, errno, "%lu bytes", sizeof(long));
-      *l=FITSLONGBLANK;
+      *l=GAL_FITSARRAY_LONG_BLANK;
       return l;
 
     case LONGLONG_IMG:
       L=malloc(sizeof(LONGLONG));
       if(L==NULL)
        error(EXIT_FAILURE, errno, "%lu bytes", sizeof(LONGLONG));
-      *L=FITSLLONGBLANK;
+      *L=GAL_FITSARRAY_LLONG_BLANK;
       return L;
 
     case FLOAT_IMG:
       f=malloc(sizeof(float));
       if(f==NULL)
        error(EXIT_FAILURE, errno, "%lu bytes", sizeof(float));
-      *f=FITSFLOATBLANK;
+      *f=GAL_FITSARRAY_FLOAT_BLANK;
       return f;
 
     case DOUBLE_IMG:
       d=malloc(sizeof(double));
       if(d==NULL)
        error(EXIT_FAILURE, errno, "%lu bytes", sizeof(double));
-      *d=FITSFLOATBLANK;
+      *d=GAL_FITSARRAY_FLOAT_BLANK;
       return d;
 
     default:
@@ -317,32 +317,32 @@ blanktovalue(void *array, int bitpix, size_t size, void 
*value)
     {
     case BYTE_IMG:
       bf=(b=array)+size;
-      do if(*b==FITSBYTEBLANK) *b=bv; while(++b<bf);
+      do if(*b==GAL_FITSARRAY_BYTE_BLANK) *b=bv; while(++b<bf);
       break;
 
     case SHORT_IMG:
       sf=(s=array)+size;
-      do if(*s==FITSSHORTBLANK) *s=sv; while(++s<sf);
+      do if(*s==GAL_FITSARRAY_SHORT_BLANK) *s=sv; while(++s<sf);
       break;
 
     case LONG_IMG:
       lf=(l=array)+size;
-      do if(*l==FITSLONGBLANK) *l=lv; while(++l<lf);
+      do if(*l==GAL_FITSARRAY_LONG_BLANK) *l=lv; while(++l<lf);
       break;
 
     case LONGLONG_IMG:
       Lf=(L=array)+size;
-      do if(*L==FITSLLONGBLANK) *L=Lv; while(++L<Lf);
+      do if(*L==GAL_FITSARRAY_LLONG_BLANK) *L=Lv; while(++L<Lf);
       break;
 
     case FLOAT_IMG:
       ff=(f=array)+size;
-      do if(*f==FITSFLOATBLANK) *f=fv; while(++f<ff);
+      do if(*f==GAL_FITSARRAY_FLOAT_BLANK) *f=fv; while(++f<ff);
       break;
 
     case DOUBLE_IMG:
       df=(d=array)+size;
-      do if(*d==FITSFLOATBLANK) *d=dv; while(++d<df);
+      do if(*d==GAL_FITSARRAY_FLOAT_BLANK) *d=dv; while(++d<df);
       break;
 
     default:
@@ -381,31 +381,34 @@ gal_fitsarray_change_type(void *in, int inbitpix, size_t 
size, int anyblank,
        case SHORT_IMG:
          bf=(b=*out)+size; do *b=*is++; while(++b<bf);
           if(anyblank)
-            {b=*out; do {b[i]=(iis[i]==FITSSHORTBLANK)?FITSBYTEBLANK:b[i];}
+            {b=*out; do {b[i]=(iis[i]==GAL_FITSARRAY_SHORT_BLANK)
+                         ?GAL_FITSARRAY_BYTE_BLANK:b[i];}
               while(++i!=size);}
           return;
        case LONG_IMG:
          bf=(b=*out)+size; do *b=*il++; while(++b<bf);
           if(anyblank)
-            {b=*out; do {b[i]=(iil[i]==FITSLONGBLANK)?FITSBYTEBLANK:b[i];}
+            {b=*out; do {b[i]=(iil[i]==GAL_FITSARRAY_LONG_BLANK)
+                         ?GAL_FITSARRAY_BYTE_BLANK:b[i];}
               while(++i!=size);}
           return;
        case LONGLONG_IMG:
          bf=(b=*out)+size; do *b=*iL++; while(++b<bf);
           if(anyblank)
-            {b=*out; do {b[i]=(iiL[i]==FITSLLONGBLANK)?FITSBYTEBLANK:b[i];}
+            {b=*out; do {b[i]=(iiL[i]==GAL_FITSARRAY_LLONG_BLANK)
+                         ?GAL_FITSARRAY_BYTE_BLANK:b[i];}
               while(++i!=size);}
           return;
        case FLOAT_IMG:
          bf=(b=*out)+size; do *b=roundf(*iif++); while(++b<bf);
           if(anyblank)
-            {b=*out; do {b[i]=isnan(iiif[i])?FITSBYTEBLANK:b[i];}
+            {b=*out; do {b[i]=isnan(iiif[i])?GAL_FITSARRAY_BYTE_BLANK:b[i];}
               while(++i!=size);}
           return;
        case DOUBLE_IMG:
          bf=(b=*out)+size; do *b=round(*id++); while(++b<bf);
           if(anyblank)
-            {b=*out; do {b[i]=isnan(iid[i])?FITSBYTEBLANK:b[i];}
+            {b=*out; do {b[i]=isnan(iid[i])?GAL_FITSARRAY_BYTE_BLANK:b[i];}
               while(++i!=size);}
           return;
        default:
@@ -421,7 +424,8 @@ gal_fitsarray_change_type(void *in, int inbitpix, size_t 
size, int anyblank,
        case BYTE_IMG:
          sf=(s=*out)+size; do *s=*ib++; while(++s<sf);
           if(anyblank)
-            {s=*out; do {s[i]=(iib[i]==FITSBYTEBLANK)?FITSSHORTBLANK:s[i];}
+            {s=*out; do {s[i]=(iib[i]==GAL_FITSARRAY_BYTE_BLANK)
+                         ?GAL_FITSARRAY_SHORT_BLANK:s[i];}
               while(++i!=size);}
           return;
        case SHORT_IMG:
@@ -429,25 +433,27 @@ gal_fitsarray_change_type(void *in, int inbitpix, size_t 
size, int anyblank,
        case LONG_IMG:
          sf=(s=*out)+size; do *s=*il++; while(++s<sf);
           if(anyblank)
-            {s=*out; do {s[i]=(iil[i]==FITSLONGBLANK)?FITSSHORTBLANK:s[i];}
+            {s=*out; do {s[i]=(iil[i]==GAL_FITSARRAY_LONG_BLANK)
+                         ?GAL_FITSARRAY_SHORT_BLANK:s[i];}
               while(++i!=size);}
           return;
        case LONGLONG_IMG:
          sf=(s=*out)+size; do *s=*iL++; while(++s<sf);
           if(anyblank)
-            {s=*out; do {s[i]=(iiL[i]==FITSLLONGBLANK)?FITSSHORTBLANK:s[i];}
+            {s=*out; do {s[i]=(iiL[i]==GAL_FITSARRAY_LLONG_BLANK)
+                         ?GAL_FITSARRAY_SHORT_BLANK:s[i];}
               while(++i!=size);}
           return;
        case FLOAT_IMG:
          sf=(s=*out)+size; do *s=roundf(*iif++); while(++s<sf);
           if(anyblank)
-            {s=*out; do {s[i]=isnan(iiif[i])?FITSSHORTBLANK:s[i];}
+            {s=*out; do {s[i]=isnan(iiif[i])?GAL_FITSARRAY_SHORT_BLANK:s[i];}
               while(++i!=size);}
           return;
        case DOUBLE_IMG:
          sf=(s=*out)+size; do *s=round(*id++); while(++s<sf);
           if(anyblank)
-            {s=*out; do {s[i]=isnan(iid[i])?FITSSHORTBLANK:s[i];}
+            {s=*out; do {s[i]=isnan(iid[i])?GAL_FITSARRAY_SHORT_BLANK:s[i];}
               while(++i!=size);}
           return;
        default:
@@ -463,13 +469,15 @@ gal_fitsarray_change_type(void *in, int inbitpix, size_t 
size, int anyblank,
        case BYTE_IMG:
          lf=(l=*out)+size; do *l=*ib++; while(++l<lf);
           if(anyblank)
-            {l=*out; do {l[i]=(iib[i]==FITSBYTEBLANK)?FITSLONGBLANK:l[i];}
+            {l=*out; do {l[i]=(iib[i]==GAL_FITSARRAY_BYTE_BLANK)
+                         ?GAL_FITSARRAY_LONG_BLANK:l[i];}
               while(++i!=size);}
           return;
        case SHORT_IMG:
          lf=(l=*out)+size; do *l=*is++; while(++l<lf);
           if(anyblank)
-            {l=*out; do {l[i]=(iis[i]==FITSSHORTBLANK)?FITSLONGBLANK:l[i];}
+            {l=*out; do {l[i]=(iis[i]==GAL_FITSARRAY_SHORT_BLANK)
+                         ?GAL_FITSARRAY_LONG_BLANK:l[i];}
               while(++i!=size);}
           return;
        case LONG_IMG:
@@ -477,19 +485,20 @@ gal_fitsarray_change_type(void *in, int inbitpix, size_t 
size, int anyblank,
        case LONGLONG_IMG:
          lf=(l=*out)+size; do *l=*iL++; while(++l<lf);
           if(anyblank)
-            {l=*out; do {l[i]=(iiL[i]==FITSLLONGBLANK)?FITSLONGBLANK:l[i];}
+            {l=*out; do {l[i]=(iiL[i]==GAL_FITSARRAY_LLONG_BLANK)
+                         ?GAL_FITSARRAY_LONG_BLANK:l[i];}
               while(++i!=size);}
           return;
        case FLOAT_IMG:
          lf=(l=*out)+size; do *l=roundf(*iif++); while(++l<lf);
           if(anyblank)
-            {l=*out; do {l[i]=isnan(iiif[i])?FITSLONGBLANK:l[i];}
+            {l=*out; do {l[i]=isnan(iiif[i])?GAL_FITSARRAY_LONG_BLANK:l[i];}
               while(++i!=size);}
           return;
        case DOUBLE_IMG:
          lf=(l=*out)+size; do *l=round(*id++); while(++l<lf);
           if(anyblank)
-            {l=*out; do {l[i]=isnan(iid[i])?FITSLONGBLANK:l[i];}
+            {l=*out; do {l[i]=isnan(iid[i])?GAL_FITSARRAY_LONG_BLANK:l[i];}
               while(++i!=size);}
           return;
        default:
@@ -505,19 +514,22 @@ gal_fitsarray_change_type(void *in, int inbitpix, size_t 
size, int anyblank,
        case BYTE_IMG:
          Lf=(L=*out)+size; do *L=*ib++; while(++L<Lf);
           if(anyblank)
-            {L=*out; do {L[i]=(iib[i]==FITSBYTEBLANK)?FITSLLONGBLANK:L[i];}
+            {L=*out; do {L[i]=(iib[i]==GAL_FITSARRAY_BYTE_BLANK)
+                         ?GAL_FITSARRAY_LLONG_BLANK:L[i];}
               while(++i!=size);}
           return;
        case SHORT_IMG:
          Lf=(L=*out)+size; do *L=*is++; while(++L<Lf);
           if(anyblank)
-            {L=*out; do {L[i]=(iis[i]==FITSSHORTBLANK)?FITSLLONGBLANK:L[i];}
+            {L=*out; do {L[i]=(iis[i]==GAL_FITSARRAY_SHORT_BLANK)
+                         ?GAL_FITSARRAY_LLONG_BLANK:L[i];}
               while(++i!=size);}
           return;
        case LONG_IMG:
          Lf=(L=*out)+size; do *L=*il++; while(++L<Lf);
           if(anyblank)
-            {L=*out; do {L[i]=(iil[i]==FITSLONGBLANK)?FITSLLONGBLANK:L[i];}
+            {L=*out; do {L[i]=(iil[i]==GAL_FITSARRAY_LONG_BLANK)
+                         ?GAL_FITSARRAY_LLONG_BLANK:L[i];}
               while(++i!=size);}
           return;
        case LONGLONG_IMG:
@@ -525,13 +537,13 @@ gal_fitsarray_change_type(void *in, int inbitpix, size_t 
size, int anyblank,
        case FLOAT_IMG:
          Lf=(L=*out)+size; do *L=roundf(*iif++); while(++L<Lf);
           if(anyblank)
-            {L=*out; do {L[i]=isnan(iiif[i])?FITSLLONGBLANK:L[i];}
+            {L=*out; do {L[i]=isnan(iiif[i])?GAL_FITSARRAY_LLONG_BLANK:L[i];}
               while(++i!=size);}
           return;
        case DOUBLE_IMG:
          Lf=(L=*out)+size; do *L=round(*id++); while(++L<Lf);
           if(anyblank)
-            {L=*out; do {L[i]=isnan(iid[i])?FITSLLONGBLANK:L[i];}
+            {L=*out; do {L[i]=isnan(iid[i])?GAL_FITSARRAY_LLONG_BLANK:L[i];}
               while(++i!=size);}
           return;
        default:
@@ -547,25 +559,29 @@ gal_fitsarray_change_type(void *in, int inbitpix, size_t 
size, int anyblank,
        case BYTE_IMG:
          ff=(f=*out)+size; do *f=*ib++; while(++f<ff);
           if(anyblank)
-            {f=*out; do {f[i]=iib[i]==FITSBYTEBLANK?FITSFLOATBLANK:f[i];}
+            {f=*out; do {f[i]=iib[i]==GAL_FITSARRAY_BYTE_BLANK
+                         ?GAL_FITSARRAY_FLOAT_BLANK:f[i];}
               while(++i!=size);}
           return;
        case SHORT_IMG:
          ff=(f=*out)+size; do *f=*is++; while(++f<ff);
           if(anyblank)
-            {f=*out; do {f[i]=iis[i]==FITSSHORTBLANK?FITSFLOATBLANK:f[i];}
+            {f=*out; do {f[i]=iis[i]==GAL_FITSARRAY_SHORT_BLANK
+                         ?GAL_FITSARRAY_FLOAT_BLANK:f[i];}
               while(++i!=size);}
           return;
        case LONG_IMG:
          ff=(f=*out)+size; do *f=*il++; while(++f<ff);
           if(anyblank)
-            {f=*out; do {f[i]=iil[i]==FITSLONGBLANK?FITSFLOATBLANK:f[i];}
+            {f=*out; do {f[i]=iil[i]==GAL_FITSARRAY_LONG_BLANK
+                         ?GAL_FITSARRAY_FLOAT_BLANK:f[i];}
               while(++i!=size);}
           return;
        case LONGLONG_IMG:
          ff=(f=*out)+size; do *f=*iL++; while(++f<ff);
           if(anyblank)
-            {f=*out; do {f[i]=iiL[i]==FITSLLONGBLANK?FITSFLOATBLANK:f[i];}
+            {f=*out; do {f[i]=iiL[i]==GAL_FITSARRAY_LLONG_BLANK
+                         ?GAL_FITSARRAY_FLOAT_BLANK:f[i];}
               while(++i!=size);}
           return;
        case FLOAT_IMG:
@@ -585,25 +601,29 @@ gal_fitsarray_change_type(void *in, int inbitpix, size_t 
size, int anyblank,
        case BYTE_IMG:
          df=(d=*out)+size; do *d=*ib++; while(++d<df);
           if(anyblank)
-            {d=*out; do {d[i]=iib[i]==FITSBYTEBLANK?FITSFLOATBLANK:d[i];}
+            {d=*out; do {d[i]=iib[i]==GAL_FITSARRAY_BYTE_BLANK
+                         ?GAL_FITSARRAY_FLOAT_BLANK:d[i];}
               while(++i!=size);}
           return;
        case SHORT_IMG:
          df=(d=*out)+size; do *d=*is++; while(++d<df);
           if(anyblank)
-            {d=*out; do {d[i]=iis[i]==FITSSHORTBLANK?FITSFLOATBLANK:d[i];}
+            {d=*out; do {d[i]=iis[i]==GAL_FITSARRAY_SHORT_BLANK
+                         ?GAL_FITSARRAY_FLOAT_BLANK:d[i];}
               while(++i!=size);}
           return;
        case LONG_IMG:
          df=(d=*out)+size; do *d=*il++; while(++d<df);
           if(anyblank)
-            {d=*out; do {d[i]=iil[i]==FITSLONGBLANK?FITSFLOATBLANK:d[i];}
+            {d=*out; do {d[i]=iil[i]==GAL_FITSARRAY_LONG_BLANK
+                         ?GAL_FITSARRAY_FLOAT_BLANK:d[i];}
               while(++i!=size);}
           return;
        case LONGLONG_IMG:
          df=(d=*out)+size; do *d=*iL++; while(++d<df);
           if(anyblank)
-            {d=*out; do {d[i]=iiL[i]==FITSLLONGBLANK?FITSFLOATBLANK:d[i];}
+            {d=*out; do {d[i]=iiL[i]==GAL_FITSARRAY_LLONG_BLANK
+                         ?GAL_FITSARRAY_FLOAT_BLANK:d[i];}
               while(++i!=size);}
           return;
        case FLOAT_IMG:
@@ -1122,8 +1142,8 @@ gal_fitsarray_copyright_end(fitsfile *fptr, struct 
fitsheaderll *headers,
   fits_write_comment(fptr, PACKAGE_STRING, &status);
   fits_write_comment(fptr, PACKAGE_URL, &status);
   /*
-  fits_write_comment(fptr, SHORTCOPYRIGHT, &status);
-  fits_write_comment(fptr, SHORTLICENSE, &status);
+  fits_write_comment(fptr, GAL_STRINGS_SHORT_COPYRIGHT, &status);
+  fits_write_comment(fptr, GAL_STRINGS_SHORT_LICENSE, &status);
   */
   gal_fitsarray_io_error(status, NULL);
 }
diff --git a/lib/mesh.c b/lib/mesh.c
index 6f7bbc1..5386466 100644
--- a/lib/mesh.c
+++ b/lib/mesh.c
@@ -952,7 +952,7 @@ gal_mesh_operate_on_mesh(struct meshparams *mp, void 
*(*meshfunc)(void *),
 
       /* Spin off the threads: */
       for(i=0;i<numthreads;++i)
-       if(mp->indexs[i*mp->thrdcols]!=NONTHRDINDEX)
+       if(mp->indexs[i*mp->thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
          {
             mtp[i].id=i;
            mtp[i].mp=mp;
@@ -1089,7 +1089,7 @@ manhattandistance(long ind, long xc, long yc, long s1)
 
 
 /* Some of the variables have different names than the meshparams
-   structure because they are to be fed into the FILL_NGB_4_ALLIMG
+   structure because they are to be fed into the GAL_NEIGHBORS_FILL_4_ALLIMG
    macro. */
 void *
 meshinterponthread(void *inparams)
@@ -1116,7 +1116,7 @@ meshinterponthread(void *inparams)
 
 
   /* Go over all the meshes for this thread. */
-  for(i=0;indexs[i]!=NONTHRDINDEX;++i)
+  for(i=0;indexs[i]!=GAL_THREADS_NON_THRD_INDEX;++i)
     {
       /* Get the index of this NaN mesh: */
       thisind=indexs[i];
@@ -1177,7 +1177,7 @@ meshinterponthread(void *inparams)
 
           /* Check the four neighbors and if they have not already
              been checked, put them into the queue. */
-          FILL_NGB_4_ALLIMG;
+          GAL_NEIGHBORS_FILL_4_ALLIMG;
           nf=(n=ngb)+numngb;
           do
             if(byt[*n]==0)
@@ -1275,7 +1275,7 @@ gal_mesh_interpolate(struct meshparams *mp, char 
*errstart)
 
       /* Spin off the threads: */
       for(i=0;i<numthreads;++i)
-       if(mp->indexs[i*mp->thrdcols]!=NONTHRDINDEX)
+       if(mp->indexs[i*mp->thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
          {
             mtp[i].id=i;
            mtp[i].mp=mp;
@@ -1459,7 +1459,7 @@ meshspatialconvonthreads(void *inparam)
   float *img=mp->img, *conv=mtp->conv, *kernel=mp->kernel;
 
   /* For each mesh in this thread, convolve the mesh */
-  for(i=0; (meshid=indexs[i])!=NONTHRDINDEX; ++i)
+  for(i=0; (meshid=indexs[i])!=GAL_THREADS_NON_THRD_INDEX; ++i)
     {
       /* Get the channel ID and the relevant information for this mesh. */
       chid=meshid/nmeshc;
@@ -1628,7 +1628,7 @@ gal_mesh_spatial_convolve_on_mesh(struct meshparams *mp, 
float **conv)
 
       /* Spin off the threads: */
       for(i=0;i<numthreads;++i)
-       if(mp->indexs[i*mp->thrdcols]!=NONTHRDINDEX)
+       if(mp->indexs[i*mp->thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
          {
             mtp[i].id=i;
            mtp[i].mp=mp;
@@ -1711,7 +1711,7 @@ corrconvindexs(struct meshparams *mp, size_t **indexs, 
size_t *numpix,
       for(a=alow; a<ahigh; ++a)
         for(b=0;b<s1;++b)
           {
-            while(*ind==NONTHRDINDEX) ++ind;
+            while(*ind==GAL_THREADS_NON_THRD_INDEX) ++ind;
             *ind++=a*s1+b;
           }
     }
@@ -1739,7 +1739,7 @@ corrconvindexs(struct meshparams *mp, size_t **indexs, 
size_t *numpix,
               */
               for(a=alow;a<ahigh;++a)
                 {
-                  while(*ind==NONTHRDINDEX) ++ind;
+                  while(*ind==GAL_THREADS_NON_THRD_INDEX) ++ind;
                   *ind++=a*s1+b;
                 }
               /* This alow is actually the ahigh in the FIRST LOOP. */
@@ -1759,7 +1759,7 @@ corrconvindexs(struct meshparams *mp, size_t **indexs, 
size_t *numpix,
           */
           for(a=alow;a<ahigh;++a)
             {
-              while(*ind==NONTHRDINDEX) ++ind;
+              while(*ind==GAL_THREADS_NON_THRD_INDEX) ++ind;
               *ind++=a*s1+b;
             }
         }
@@ -1841,7 +1841,7 @@ gal_mesh_change_to_full_convolution(struct meshparams 
*mp, float *conv)
 
       /* Spin off the threads: */
       for(i=0;i<mp->numthreads;++i)
-        if(indexs[i*thrdcols]!=NONTHRDINDEX)
+        if(indexs[i*thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
           {
             scp[i].b=&b;
             gal_spatialconvolve_pparams(mp->img, mp->s0, mp->s1, mp->kernel,
diff --git a/lib/mode.c b/lib/mode.c
index 6fdef3f..bc68997 100644
--- a/lib/mode.c
+++ b/lib/mode.c
@@ -325,7 +325,7 @@ mirrormaxdiff(float *a, size_t size, size_t m,
         result is not acceptable! */
       if(i>j+errordiff)
        {
-         maxdiff=MIRRORISABOVERESULT;
+         maxdiff=GAL_MODE_MIRROR_IS_ABOVE_RESULT;
          break;
        }
       absdiff  = i>j ? i-j : j-i;
@@ -349,13 +349,12 @@ mirrormaxdiff(float *a, size_t size, size_t m,
    middle points in the given interval and thus decreasing the
    interval until a certain tolerance is reached.
 
-   If the input interval is on points `a` and `b`, then the middle
-   point (lets call it `c`, where c>a and c<b) to test should be
-   positioned such that (b-c)/(c-a)=GOLDENRATIO. Once we open up this
-   relation, we can find c using:
-   c=(b+GOLDENRATIO*a)/(1+GOLDENRATIO). We need a fourth point to be
-   placed between. With this configuration, the probing point is
-   located at:  */
+   If the input interval is on points `a` and `b`, then the middle point (lets
+   call it `c`, where c>a and c<b) to test should be positioned such that
+   (b-c)/(c-a)=GAL_MODE_GOLDEN_RATIO. Once we open up this relation, we can 
find
+   c using: c=(b+GAL_MODE_GOLDEN_RATIO*a)/(1+GAL_MODE_GOLDEN_RATIO). We need a
+   fourth point to be placed between. With this configuration, the probing 
point
+   is located at: */
 size_t
 modegoldenselection(struct modeparams *mp)
 {
@@ -368,9 +367,9 @@ modegoldenselection(struct modeparams *mp)
 
   /* Find the probing point in the larger interval. */
   if(mp->highi-mp->midi > mp->midi-mp->lowi)
-    di = mp->midi + TWOTAKEGOLDENRATIO * (float)(mp->highi-mp->midi);
+    di = mp->midi + GAL_MODE_TWO_TAKE_GOLDEN_RATIO 
*(float)(mp->highi-mp->midi);
   else
-    di = mp->midi - TWOTAKEGOLDENRATIO * (float)(mp->midi-mp->lowi);
+    di = mp->midi - GAL_MODE_TWO_TAKE_GOLDEN_RATIO * 
(float)(mp->midi-mp->lowi);
 
   /* Since these are all indexs (and positive) we don't need an
      absolute value, highi is also always larger than lowi! In some
@@ -399,11 +398,11 @@ modegoldenselection(struct modeparams *mp)
   */
   /* +++++++++++++ The mirrored distribution's cumulative frequency
      plot has be lower than the actual's cfp. If it isn't, `di` will
-     be MIRRORISABOVERESULT. In this case, the normal golden section
-     minimization is not going to give us what we want. So I have
-     added this modification to it. In such cases, we want the search
-     to go to the lower intervals.*/
-  if(dd==MIRRORISABOVERESULT)
+     be GAL_MODE_MIRROR_IS_ABOVE_RESULT. In this case, the normal golden 
section
+     minimization is not going to give us what we want. So I have added this
+     modification to it. In such cases, we want the search to go to the lower
+     intervals.*/
+  if(dd==GAL_MODE_MIRROR_IS_ABOVE_RESULT)
     {
       if(mp->midi < di)
        {
@@ -478,7 +477,8 @@ modesymmetricity(float *a, size_t size, size_t mi, float 
errorstdm,
   mf=a[mi];
   errdiff=errorstdm*sqrt(mi);
   topi = 2*mi>size-1 ? size-1 : 2*mi;
-  af=a[gal_statistics_index_from_quantile(2*mi+1,   SYMMETRICITYLOWQUANT)];
+  af=a[gal_statistics_index_from_quantile(2*mi+1,
+                                          GAL_MODE_SYMMETRICITY_LOW_QUANT)];
 
   /* This loop is very similar to that of mirrormaxdiff(). It will
      find the index where the difference between the two cumulative
@@ -536,8 +536,9 @@ float
 gal_mode_value_from_sym(float *sorted, size_t size, size_t modeindex, float 
sym)
 {
   float mf=sorted[modeindex];
-  float af=sorted[gal_statistics_index_from_quantile(2*modeindex+1,
-                                                     SYMMETRICITYLOWQUANT)];
+  float af=
+    sorted[gal_statistics_index_from_quantile(2*modeindex+1,
+                                              
GAL_MODE_SYMMETRICITY_LOW_QUANT)];
   return sym*(mf-af)+mf;
 }
 
@@ -553,7 +554,7 @@ gal_mode_value_from_sym(float *sorted, size_t size, size_t 
modeindex, float sym)
    A good mode will have:
 
    modequant=(float)(modeindex)/(float)size;
-   modesym>MODESYMGOOD && modequant>MODELOWQUANTGOOD
+   modesym>GAL_MODE_SYM_GOOD && modequant>GAL_MODE_LOW_QUANT_GOOD
 */
 void
 gal_mode_index_in_sorted(float *sorted, size_t size, float errorstdm,
@@ -570,9 +571,10 @@ gal_mode_index_in_sorted(float *sorted, size_t size, float 
errorstdm,
   if(mp.numcheck>1000)
     mp.interval=mp.numcheck/1000;
   else mp.interval=1;
-  mp.lowi  = gal_statistics_index_from_quantile(size, MODELOWQUANTILE);
-  mp.highi = gal_statistics_index_from_quantile(size, MODEHIGHQUANTILE);
-  mp.midi  = ((float)mp.highi+GOLDENRATIO*(float)mp.lowi)/(1+GOLDENRATIO);
+  mp.lowi  = gal_statistics_index_from_quantile(size, GAL_MODE_LOW_QUANTILE);
+  mp.highi = gal_statistics_index_from_quantile(size, GAL_MODE_HIGH_QUANTILE);
+  mp.midi  = ((float)mp.highi
+              +GAL_MODE_GOLDEN_RATIO*(float)mp.lowi)/(1+GAL_MODE_GOLDEN_RATIO);
   mp.midd  = mirrormaxdiff(mp.sorted, mp.size, mp.midi, mp.numcheck,
                           mp.interval, mp.errorstdm);
 
diff --git a/lib/polygon.c b/lib/polygon.c
index 8c3672d..b5709e7 100644
--- a/lib/polygon.c
+++ b/lib/polygon.c
@@ -76,23 +76,24 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
    the overlap between a quadrilateral and the pixel grid or the
    quadrilaterral its self.
 
-   MAXPOLYGONCORNERS is defined so there will be no need to allocate
+   GAL_POLYGON_MAX_CORNERS is defined so there will be no need to allocate
    these temporary arrays seprately. Since we are dealing with pixels,
    the polygon can't really have too many vertices.
 */
 void
 gal_polygon_ordered_corners(double *in, size_t n, size_t *ordinds)
 {
-  double angles[MAXPOLYGONCORNERS];
-  size_t i, tmp, aindexs[MAXPOLYGONCORNERS], tindexs[MAXPOLYGONCORNERS];
+  double angles[GAL_POLYGON_MAX_CORNERS];
+  size_t i, tmp, aindexs[GAL_POLYGON_MAX_CORNERS],
+    tindexs[GAL_POLYGON_MAX_CORNERS];
 
-  if(n>MAXPOLYGONCORNERS)
+  if(n>GAL_POLYGON_MAX_CORNERS)
     error(EXIT_FAILURE, 0, "Most probably a bug! The number of corners "
           "given to `gal_polygon_ordered_corners' is more than %d. This is an "
           "internal value and cannot be set from the outside. Most probably "
           "Some bug has caused this un-normal value. Please contact us at "
           PACKAGE_BUGREPORT" so we can solve this problem.",
-          MAXPOLYGONCORNERS);
+          GAL_POLYGON_MAX_CORNERS);
 
   /* For a check:
   printf("\n\nBefore sorting:\n");
@@ -166,7 +167,7 @@ gal_polygon_area(double *v, size_t n)
 
   while(i<n)
     {
-      sum+=crossproduct(v+j*2, v+i*2);
+      sum+=GAL_POLYGON_CROSS_PRODUCT(v+j*2, v+i*2);
       j=i++;
     }
   return fabs(sum)/2.0f;
@@ -194,7 +195,7 @@ gal_polygon_pin(double *v, double *p, size_t n)
 
   while(i<n)
     {
-      if( pleftofline(&v[j*2], &v[i*2], p) )
+      if( GAL_POLYGON_LEFT_OF_LINE(&v[j*2], &v[i*2], p) )
         j=i++;
       else return 0;
     }
@@ -217,9 +218,9 @@ gal_polygon_ppropin(double *v, double *p, size_t n)
       /* For a check:
       printf("(%.2f, %.2f), (%.2f, %.2f), (%.2f, %.2f)=%f\n",
              v[j*2], v[j*2+1], v[i*2], v[i*2+1], p[0], p[1],
-             tricrossproduct(&v[j*2], &v[i*2], p));
+             GAL_POLYGON_TRI_CROSS_PRODUCT(&v[j*2], &v[i*2], p));
       */
-      if( ppropleftofline(&v[j*2], &v[i*2], p) )
+      if( GAL_POLYGON_PROP_LEFT_OF_LINE(&v[j*2], &v[i*2], p) )
         j=i++;
       else
         return 0;
@@ -245,8 +246,8 @@ int
 seginfintersection(double *Aa, double *Ab, double *Ba, double *Bb,
                    double *o)
 {
-  int Aacollinear=pcollinearwithline(Ba, Bb, Aa);
-  int Abcollinear=pcollinearwithline(Ba, Bb, Ab);
+  int Aacollinear=GAL_POLYGON_COLLINEAR_WITH_LINE(Ba, Bb, Aa);
+  int Abcollinear=GAL_POLYGON_COLLINEAR_WITH_LINE(Ba, Bb, Ab);
 
   /* If all four points lie on the same line, there is infinite
      intersections, so return -1. If three of the points are
@@ -276,7 +277,8 @@ seginfintersection(double *Aa, double *Ab, double *Ba, 
double *Bb,
      Note that the denominators and the parenthesis with the
      subtraction of multiples are the same.
   */
-  if ( ppropleftofline(Ba, Bb, Aa) ^ ppropleftofline(Ba, Bb, Ab) )
+  if ( GAL_POLYGON_PROP_LEFT_OF_LINE(Ba, Bb, Aa)
+       ^ GAL_POLYGON_PROP_LEFT_OF_LINE(Ba, Bb, Ab) )
     {
       /* Find the intersection point of two infinite lines (we assume
          Aa-Ab is infinite in calculating this): */
@@ -290,10 +292,10 @@ seginfintersection(double *Aa, double *Ab, double *Ba, 
double *Bb,
              );
 
       /* Now check if the output is in the same range as Aa--Ab. */
-      if( o[0]>=minoftwo(Aa[0], Ab[0])-ROUNDERR
-          && o[0]<=maxoftwo(Aa[0], Ab[0])+ROUNDERR
-          && o[1]>=minoftwo(Aa[1], Ab[1])-ROUNDERR
-          && o[1]<=maxoftwo(Aa[1], Ab[1])+ROUNDERR )
+      if( o[0]>=GAL_POLYGON_MIN_OF_TWO(Aa[0], Ab[0])-GAL_POLYGON_ROUND_ERR
+          && o[0]<=GAL_POLYGON_MAX_OF_TWO(Aa[0], Ab[0])+GAL_POLYGON_ROUND_ERR
+          && o[1]>=GAL_POLYGON_MIN_OF_TWO(Aa[1], Ab[1])-GAL_POLYGON_ROUND_ERR
+          && o[1]<=GAL_POLYGON_MAX_OF_TWO(Aa[1], Ab[1])+GAL_POLYGON_ROUND_ERR )
         return 1;
       else
         return 0;
@@ -340,14 +342,14 @@ void
 gal_polygon_clip(double *s, size_t n, double *c, size_t m,
                  double *o, size_t *numcrn)
 {
-  double in[2*MAXPOLYGONCORNERS], *S, *E;
+  double in[2*GAL_POLYGON_MAX_CORNERS], *S, *E;
   size_t t, ii=m-1, i=0, jj, j, outnum, innum;
 
   /*
-  if(n>MAXPOLYGONCORNERS || m>MAXPOLYGONCORNERS)
+  if(n>GAL_POLYGON_MAX_CORNERS || m>GAL_POLYGON_MAX_CORNERS)
     error(EXIT_FAILURE, 0, "The two polygons given to the function "
           "gal_polygon_clip in polygon.c have %lu and %lu vertices. They 
cannot"
-          " have any values larger than %lu.", n, m, MAXPOLYGONCORNERS);
+          " have any values larger than %lu.", n, m, GAL_POLYGON_MAX_CORNERS);
   */
 
   /* 2*outnum because for each vertice, there are two elements. */
@@ -370,14 +372,14 @@ gal_polygon_clip(double *s, size_t n, double *c, size_t m,
           S=&in[jj*2];                      /* Starting point. */
           E=&in[j*2];                       /* Ending point.   */
 
-          if( ppropleftofline(&c[ii*2], &c[i*2], E) )
+          if( GAL_POLYGON_PROP_LEFT_OF_LINE(&c[ii*2], &c[i*2], E) )
             {
-              if( ppropleftofline(&c[ii*2], &c[i*2], S)==0 )
+              if( GAL_POLYGON_PROP_LEFT_OF_LINE(&c[ii*2], &c[i*2], S)==0 )
                 if( seginfintersection(S, E, &c[ii*2], &c[i*2], &o[2*outnum])
                     >0) ++outnum;
               o[2*outnum]=E[0]; o[2*outnum+1]=E[1]; ++outnum;
             }
-          else if( ppropleftofline(&c[ii*2], &c[i*2], S) )
+          else if( GAL_POLYGON_PROP_LEFT_OF_LINE(&c[ii*2], &c[i*2], S) )
             if( seginfintersection(S, E, &c[ii*2], &c[i*2], &o[2*outnum])>0 )
               ++outnum;
           /*
diff --git a/lib/spatialconvolve.c b/lib/spatialconvolve.c
index 372c4b7..46ea03d 100644
--- a/lib/spatialconvolve.c
+++ b/lib/spatialconvolve.c
@@ -85,7 +85,7 @@ gal_spatialconvolve_thread(void *inparam)
   float *input=scp->input, *kernel=scp->kernel, *out=scp->out;
 
   /* Go over all the pixels associated with this thread. */
-  for(i=0;indexs[i]!=NONTHRDINDEX;++i)
+  for(i=0;indexs[i]!=GAL_THREADS_NON_THRD_INDEX;++i)
     {
       /* Set the index, if it is a NaN pixel, then set the output to
          be NaN too. */
@@ -210,7 +210,7 @@ gal_spatialconvolve_convolve(float *input, size_t is0, 
size_t is1,
 
       /* Spin off the threads: */
       for(i=0;i<nt;++i)
-        if(indexs[i*thrdcols]!=NONTHRDINDEX)
+        if(indexs[i*thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
           {
             scp[i].b=&b;
             gal_spatialconvolve_pparams(input, is0, is1, kernel, ks0, ks1, nt,
diff --git a/lib/statistics.c b/lib/statistics.c
index 8a6dc78..d542c24 100644
--- a/lib/statistics.c
+++ b/lib/statistics.c
@@ -1066,7 +1066,7 @@ gal_statistics_sigma_clip_converge(float *array, int 
o1_n0, size_t num_elem,
   else orderedarray=array;
 
   start=orderedarray;
-  while(counter<MAXSIGCLIPCONVERGE)
+  while(counter<GAL_STATISTICS_MAX_SIG_CLIP_CONVERGE)
     {
       oldstart=start;
 
diff --git a/lib/timing.c b/lib/timing.c
index 5a751d6..00e21b1 100644
--- a/lib/timing.c
+++ b/lib/timing.c
@@ -61,9 +61,10 @@ gal_timing_report(struct timeval *t1, char *jobname, size_t 
level)
   else if(level==1)
     {
       if(t1)
-       printf("  - %-"VERBMSGLENGTH_T"s %f seconds\n", jobname, dt);
+       printf("  - %-"GAL_TIMING_VERB_MSG_LENGTH_T"s %f seconds\n",
+               jobname, dt);
       else
-       printf("  - %-"VERBMSGLENGTH_T"s\n", jobname);
+       printf("  - %-"GAL_TIMING_VERB_MSG_LENGTH_T"s\n", jobname);
     }
   else if(level==2)
     printf("  ---- %s\n", jobname);
diff --git a/lib/txtarrayvv.c b/lib/txtarrayvv.c
index a42e5ff..45a2bfd 100644
--- a/lib/txtarrayvv.c
+++ b/lib/txtarrayvv.c
@@ -74,7 +74,7 @@ txttablesize(char *filename, size_t *outs0, size_t *outs1)
   while( getline(&line, &len, fp) != -1 )
     {
       /* Read the first token: */
-      firsttoken=strtok(line, DELIMITERS);
+      firsttoken=strtok(line, GAL_TXTARRAY_DELIMITERS);
 
       /* If there are no non-delimters in the line (can happen if the
         line is a blank line in the end of the file). */
@@ -89,7 +89,7 @@ txttablesize(char *filename, size_t *outs0, size_t *outs1)
       if(s0==0)  /* We are on the first row of data, find s1. */
        {
          s1=1;
-         while( strtok(NULL, DELIMITERS) != NULL )
+         while( strtok(NULL, GAL_TXTARRAY_DELIMITERS) != NULL )
            ++s1;
        }
       ++s0;
@@ -120,7 +120,7 @@ savetolog(FILE **log, char *filename, size_t lineno, size_t 
s0,
   else                         /* Not yet created.          */
     {
       errno=0;
-      *log=fopen(TXTARRAYVVLOG, "w");
+      *log=fopen(GAL_TXTARRAY_LOG, "w");
       if(*log==NULL)
        error(EXIT_FAILURE, errno, "%s", filename);
       fprintf(*log, "# Elements in %s which could not be read as a \n"
@@ -189,7 +189,7 @@ filltable(char *filename, double *array, size_t s0, size_t 
s1)
       ++lineno;
 
       /* Read the first token: */
-      token=strtok(line, DELIMITERS);
+      token=strtok(line, GAL_TXTARRAY_DELIMITERS);
 
       /* If there are no non-delimters in the line (can happen if the
         line is a blank line in the end of the file). */
@@ -204,7 +204,7 @@ filltable(char *filename, double *array, size_t s0, size_t 
s1)
       CONVERTANDSAVE;
 
       /* Read the rest of the tokens: */
-      while( (token=strtok(NULL, DELIMITERS))!=NULL )
+      while( (token=strtok(NULL, GAL_TXTARRAY_DELIMITERS))!=NULL )
        {
          if(ts1>=s1)
            error_at_line(EXIT_FAILURE, 0, filename, lineno,
@@ -229,7 +229,7 @@ filltable(char *filename, double *array, size_t s0, size_t 
s1)
     {
       errno=0;
       if(fclose(log)==EOF)
-       error(EXIT_FAILURE, errno, "%s", TXTARRAYVVLOG);
+       error(EXIT_FAILURE, errno, "%s", GAL_TXTARRAY_LOG);
     }
 }
 
@@ -288,10 +288,10 @@ doformatting(int numcols, char **fmt, int *int_cols, int 
*accu_cols,
     {
       /* Allocate space for the format string of each column: */
       errno=0;
-      fmt[i]=malloc(FMTLENGTH * sizeof(char));
+      fmt[i]=malloc(GAL_TXTARRAY_FMT_LENGTH * sizeof(char));
       if(fmt[i]==NULL)
        error(EXIT_FAILURE, errno, "txtarrayvv, space for format "
-             "string %d, with %d elements", i, FMTLENGTH);
+             "string %d, with %d elements", i, GAL_TXTARRAY_FMT_LENGTH);
 
       /* See if this is an int column. */
       found=0;
diff --git a/src/convertt/args.h b/src/convertt/args.h
index c135047..7d15436 100644
--- a/src/convertt/args.h
+++ b/src/convertt/args.h
@@ -29,7 +29,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 /* Definition parameters for the argp: */
-const char *argp_program_version=SPACK_STRING"\n"COPYRIGHT
+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[] = "InputFile1 [InputFile2] ... [InputFile4]";
@@ -40,11 +40,11 @@ static char args_doc[] = "InputFile1 [InputFile2] ... 
[InputFile4]";
 
 const char doc[] =
   /* Before the list of options: */
-  TOPHELPINFO
+  GAL_STRINGS_TOP_HELP_INFO
   SPACK_NAME" will convert any of the known input formats to any other "
   "of the known formats. The output file will have the same number of "
   "pixels.\n"
-  MOREHELPINFO
+  GAL_STRINGS_MORE_HELP_INFO
   /* After the list of options: */
   "\v"
   PACKAGE_NAME" home page: "PACKAGE_URL;
diff --git a/src/convertt/cite.h b/src/convertt/cite.h
index 92d8502..7b5701c 100644
--- a/src/convertt/cite.h
+++ b/src/convertt/cite.h
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
           "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, GNUASTROBIBTEX,        \
+          SPACK_NAME, SPACK_NAME, SPACK_STRING, GAL_STRINGS_BIBTEX,    \
           MKPROFBIBTEX);                                               \
     exit(EXIT_SUCCESS);                                                        
\
 }
diff --git a/src/convertt/ui.c b/src/convertt/ui.c
index 605f5a4..b87be76 100644
--- a/src/convertt/ui.c
+++ b/src/convertt/ui.c
@@ -90,7 +90,7 @@ readconfig(char *filename, struct converttparams *p)
   while(getline(&line, &len, fp) != -1)
     {
       /* Prepare the "name" and "value" strings, also set lineno. */
-      STARTREADINGLINE;
+      GAL_CONFIGFILES_START_READING_LINE;
 
       /* Inputs: */
       if(strcmp(name, "hdu")==0)
@@ -165,7 +165,7 @@ readconfig(char *filename, struct converttparams *p)
 
       /* Operating modes: */
       /* Read options common to all programs */
-      READ_COMMONOPTIONS_FROM_CONF
+      GAL_CONFIGFILES_READ_COMMONOPTIONS_FROM_CONF
 
 
       else
@@ -191,13 +191,13 @@ printvalues(FILE *fp, struct converttparams *p)
      commented line explaining the options in that group. */
   fprintf(fp, "\n# Input image:\n");
   if(cp->hduset)
-    PRINTSTINGMAYBEWITHSPACE("hdu", cp->hdu);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("hdu", cp->hdu);
   if(up->hdu2set)
-    PRINTSTINGMAYBEWITHSPACE("hdu2", up->hdu2);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("hdu2", up->hdu2);
   if(up->hdu3set)
-    PRINTSTINGMAYBEWITHSPACE("hdu3", up->hdu3);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("hdu3", up->hdu3);
   if(up->hdu4set)
-    PRINTSTINGMAYBEWITHSPACE("hdu4", up->hdu4);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("hdu4", up->hdu4);
 
 
   fprintf(fp, "\n# Output parameters:\n");
@@ -223,7 +223,7 @@ printvalues(FILE *fp, struct converttparams *p)
      options, then the (possible options particular to this
      program). */
   fprintf(fp, "\n# Operating modes:\n");
-  PRINT_COMMONOPTIONS;
+  GAL_CONFIGFILES_PRINT_COMMONOPTIONS;
 }
 
 
@@ -240,27 +240,27 @@ checkifset(struct converttparams *p)
 
   int intro=0;
   if(cp->hduset==0)
-    REPORT_NOTSET("hdu");
+    GAL_CONFIGFILES_REPORT_NOTSET("hdu");
   if(up->hdu2set==0)
-    REPORT_NOTSET("hdu2");
+    GAL_CONFIGFILES_REPORT_NOTSET("hdu2");
   if(up->hdu3set==0)
-    REPORT_NOTSET("hdu3");
+    GAL_CONFIGFILES_REPORT_NOTSET("hdu3");
   if(up->hdu4set==0)
-    REPORT_NOTSET("hdu4");
+    GAL_CONFIGFILES_REPORT_NOTSET("hdu4");
   if(up->qualityset==0)
-    REPORT_NOTSET("quality");
+    GAL_CONFIGFILES_REPORT_NOTSET("quality");
   if(up->widthincmset==0)
-    REPORT_NOTSET("widthincm");
+    GAL_CONFIGFILES_REPORT_NOTSET("widthincm");
   if(up->borderwidthset==0)
-    REPORT_NOTSET("borderwidth");
+    GAL_CONFIGFILES_REPORT_NOTSET("borderwidth");
   if(up->fluxlowset==0)
-    REPORT_NOTSET("fluxlow");
+    GAL_CONFIGFILES_REPORT_NOTSET("fluxlow");
   if(up->fluxhighset==0)
-    REPORT_NOTSET("fluxhigh");
+    GAL_CONFIGFILES_REPORT_NOTSET("fluxhigh");
   if(up->maxbyteset==0)
-    REPORT_NOTSET("maxbyte");
+    GAL_CONFIGFILES_REPORT_NOTSET("maxbyte");
 
-  END_OF_NOTSET_REPORT;
+  GAL_CONFIGFILES_END_OF_NOTSET_REPORT;
 }
 
 
@@ -646,10 +646,10 @@ preparearrays(struct converttparams *p)
           df = (d=p->ch[p->numch]) + p->s0[p->numch]*p->s1[p->numch];
           do if(isnan(*d++)) break; while(d<df);
           if(d==df)
-            gal_checkset_check_remove_file(TXTARRAYVVLOG, 0);
+            gal_checkset_check_remove_file(GAL_TXTARRAY_LOG, 0);
           else
             error(EXIT_FAILURE, 0, "%s contains non-numeric data, see %s.",
-                  names[i], TXTARRAYVVLOG);
+                  names[i], GAL_TXTARRAY_LOG);
           p->bitpixs[p->numch]=DOUBLE_IMG;
           ++p->numch;
         }
@@ -695,14 +695,14 @@ setparams(int argc, char *argv[], struct converttparams 
*p)
     error(EXIT_FAILURE, errno, "Parsing arguments");
 
   /* Add the user default values and save them if asked. */
-  CHECKSETCONFIG;
+  GAL_CONFIGFILES_CHECK_SET_CONFIG;
 
   /* Check if all the required parameters are set. */
   checkifset(p);
 
   /* Print the values for each parameter. */
   if(cp->printparams)
-    REPORT_PARAMETERS_SET;
+    GAL_CONFIGFILES_REPORT_PARAMETERS_SET;
 
   /* Prepare the arrays: */
   preparearrays(p);
diff --git a/src/convolve/args.h b/src/convolve/args.h
index 7a93010..569036d 100644
--- a/src/convolve/args.h
+++ b/src/convolve/args.h
@@ -29,7 +29,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 /* Definition parameters for the argp: */
-const char *argp_program_version=SPACK_STRING"\n"COPYRIGHT
+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[] = "InputFile";
@@ -40,11 +40,11 @@ static char args_doc[] = "InputFile";
 
 const char doc[] =
   /* Before the list of options: */
-  TOPHELPINFO
+  GAL_STRINGS_TOP_HELP_INFO
   SPACK_NAME" will convolve an input image with a given spatial kernel "
   "(image) in the spatial domain (no edge effects) or frequency domain. "
   "The latter suffers from edge effects, but can be much faster.\n"
-  MOREHELPINFO
+  GAL_STRINGS_MORE_HELP_INFO
   /* After the list of options: */
   "\v"
   PACKAGE_NAME" home page: "PACKAGE_URL;
diff --git a/src/convolve/cite.h b/src/convolve/cite.h
index 30421e0..d715a37 100644
--- a/src/convolve/cite.h
+++ b/src/convolve/cite.h
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.x
           "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, GNUASTROBIBTEX,        \
+          SPACK_NAME, SPACK_NAME, SPACK_STRING, GAL_STRINGS_BIBTEX,    \
           MKPROFBIBTEX);                                               \
     exit(EXIT_SUCCESS);                                                        
\
 }
diff --git a/src/convolve/convolve.c b/src/convolve/convolve.c
index abb095a..f219e29 100644
--- a/src/convolve/convolve.c
+++ b/src/convolve/convolve.c
@@ -481,7 +481,7 @@ onedimensionfft(void *inparam)
      by each other) is stored in p->pimg. So the check below works
      both in the forward and the backward transformation.
   */
-  for(i=0;indexs[i]!=NONTHRDINDEX;++i)
+  for(i=0;indexs[i]!=GAL_THREADS_NON_THRD_INDEX;++i)
     {
       data = ( indexs[i]<maxindex
                ? &pimg[ 2*indexs[i]*indmultip ]   /* *2 because complex. */
@@ -558,7 +558,7 @@ twodimensionfft(struct convolveparams *p, struct 
fftonthreadparams *fp,
 
       /* Spin off the threads: */
       for(i=0;i<nt;++i)
-        if(indexs[i*thrdcols]!=NONTHRDINDEX)
+        if(indexs[i*thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
           {
             fp[i].id=i;
             fp[i].b=&b;
@@ -598,7 +598,7 @@ twodimensionfft(struct convolveparams *p, struct 
fftonthreadparams *fp,
       else nb=nt+1;
       gal_threads_attr_barrier_init(&attr, &b, nb);
       for(i=0;i<nt;++i)
-        if(indexs[i*thrdcols]!=NONTHRDINDEX)
+        if(indexs[i*thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
           {
             fp[i].b=&b;
             fp[i].stride=p->ps1; /* On each column, stride is p->ps1 */
diff --git a/src/convolve/ui.c b/src/convolve/ui.c
index b42a35e..839ec95 100644
--- a/src/convolve/ui.c
+++ b/src/convolve/ui.c
@@ -90,7 +90,7 @@ readconfig(char *filename, struct convolveparams *p)
   while(getline(&line, &len, fp) != -1)
     {
       /* Prepare the "name" and "value" strings, also set lineno. */
-      STARTREADINGLINE;
+      GAL_CONFIGFILES_START_READING_LINE;
 
 
 
@@ -203,7 +203,7 @@ readconfig(char *filename, struct convolveparams *p)
        }
 
       /* Read options common to all programs */
-      READ_COMMONOPTIONS_FROM_CONF
+      GAL_CONFIGFILES_READ_COMMONOPTIONS_FROM_CONF
 
 
       else
@@ -229,15 +229,15 @@ printvalues(FILE *fp, struct convolveparams *p)
 
   fprintf(fp, "\n# Input:\n");
   if(cp->hduset)
-    PRINTSTINGMAYBEWITHSPACE("hdu", cp->hdu);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("hdu", cp->hdu);
   if(up->masknameset)
-    PRINTSTINGMAYBEWITHSPACE("mask", up->maskname);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("mask", up->maskname);
   if(up->mhduset)
-    PRINTSTINGMAYBEWITHSPACE("mhdu", up->mhdu);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("mhdu", up->mhdu);
   if(up->kernelnameset)
-    PRINTSTINGMAYBEWITHSPACE("kernel", up->kernelname);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("kernel", up->kernelname);
   if(up->khduset)
-    PRINTSTINGMAYBEWITHSPACE("khdu", up->khdu);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("khdu", up->khdu);
 
 
 
@@ -264,7 +264,7 @@ printvalues(FILE *fp, struct convolveparams *p)
      options, then the (possible options particular to this
      program). */
   fprintf(fp, "\n# Operating modes:\n");
-  PRINT_COMMONOPTIONS;
+  GAL_CONFIGFILES_PRINT_COMMONOPTIONS;
   if(up->spatialset)
     fprintf(fp, CONF_SHOWFMT"%d\n", "spatial", p->spatial);
   if(up->frequencyset)
@@ -288,34 +288,34 @@ checkifset(struct convolveparams *p)
 
   /* Input: */
   if(cp->hduset==0)
-    REPORT_NOTSET("hdu");
+    GAL_CONFIGFILES_REPORT_NOTSET("hdu");
   if(up->kernelnameset==0)
-    REPORT_NOTSET("kernel");
+    GAL_CONFIGFILES_REPORT_NOTSET("kernel");
   if(up->khduset==0)
-    REPORT_NOTSET("khdu");
+    GAL_CONFIGFILES_REPORT_NOTSET("khdu");
 
 
   /* Mesh grid: */
   if(up->meshsizeset==0)
-    REPORT_NOTSET("meshsize");
+    GAL_CONFIGFILES_REPORT_NOTSET("meshsize");
   if(up->nch1set==0)
-    REPORT_NOTSET("nch1");
+    GAL_CONFIGFILES_REPORT_NOTSET("nch1");
   if(up->nch2set==0)
-    REPORT_NOTSET("nch2");
+    GAL_CONFIGFILES_REPORT_NOTSET("nch2");
   if(up->lastmeshfracset==0)
-    REPORT_NOTSET("lastmeshfrac");
+    GAL_CONFIGFILES_REPORT_NOTSET("lastmeshfrac");
   if(up->fullconvolutionset==0)
-    REPORT_NOTSET("fullconvolution");
+    GAL_CONFIGFILES_REPORT_NOTSET("fullconvolution");
 
 
   /* Operating mode: */
   if(up->spatialset==0 && up->frequencyset==0)
-    REPORT_NOTSET("spatial or frequency");
+    GAL_CONFIGFILES_REPORT_NOTSET("spatial or frequency");
   if(up->makekernelset==0)
-    REPORT_NOTSET("makekernel");
+    GAL_CONFIGFILES_REPORT_NOTSET("makekernel");
 
 
-  END_OF_NOTSET_REPORT;
+  GAL_CONFIGFILES_END_OF_NOTSET_REPORT;
 }
 
 
@@ -558,14 +558,14 @@ setparams(int argc, char *argv[], struct convolveparams 
*p)
     error(EXIT_FAILURE, errno, "Parsing arguments");
 
   /* Add the user default values and save them if asked. */
-  CHECKSETCONFIG;
+  GAL_CONFIGFILES_CHECK_SET_CONFIG;
 
   /* Check if all the required parameters are set. */
   checkifset(p);
 
   /* Print the values for each parameter. */
   if(cp->printparams)
-    REPORT_PARAMETERS_SET;
+    GAL_CONFIGFILES_REPORT_PARAMETERS_SET;
 
   /* Do a sanity check, then remove the possibly existing log file
      created by gal_txtarray_txt_to_array. */
diff --git a/src/header/args.h b/src/header/args.h
index 3610c28..e010c22 100644
--- a/src/header/args.h
+++ b/src/header/args.h
@@ -46,7 +46,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 /* Definition parameters for the argp: */
-const char *argp_program_version=SPACK_STRING"\n"COPYRIGHT
+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";
@@ -57,11 +57,11 @@ static char args_doc[] = "ASTRdata";
 
 const char doc[] =
   /* Before the list of options: */
-  TOPHELPINFO
+  GAL_STRINGS_TOP_HELP_INFO
   SPACK_NAME" print the header information in any astronomical data file"
   "header. It can also manipulate (add, remove or modify) any of the "
   "existing keywords in a data header. \n"
-  MOREHELPINFO
+  GAL_STRINGS_MORE_HELP_INFO
   /* After the list of options: */
   "\v"
   PACKAGE_NAME" home page: "PACKAGE_URL;
diff --git a/src/header/cite.h b/src/header/cite.h
index 5acf8a2..e355d81 100644
--- a/src/header/cite.h
+++ b/src/header/cite.h
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
           "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, GNUASTROBIBTEX,        \
+          SPACK_NAME, SPACK_NAME, SPACK_STRING, GAL_STRINGS_BIBTEX,    \
           HEADERBIBTEX);                                               \
     exit(EXIT_SUCCESS);                                                        
\
 }
diff --git a/src/header/ui.c b/src/header/ui.c
index 8880584..1b4d78a 100644
--- a/src/header/ui.c
+++ b/src/header/ui.c
@@ -93,7 +93,7 @@ readconfig(char *filename, struct headerparams *p)
   while(getline(&line, &len, fp) != -1)
     {
       /* Prepare the "name" and "value" strings, also set lineno. */
-      STARTREADINGLINE;
+      GAL_CONFIGFILES_START_READING_LINE;
 
 
 
@@ -119,7 +119,7 @@ readconfig(char *filename, struct headerparams *p)
 
       /* Operating modes: */
       /* Read options common to all programs */
-      READ_COMMONOPTIONS_FROM_CONF
+      GAL_CONFIGFILES_READ_COMMONOPTIONS_FROM_CONF
 
 
       else
@@ -146,14 +146,14 @@ printvalues(FILE *fp, struct headerparams *p)
      commented line explaining the options in that group. */
   fprintf(fp, "\n# Input image:\n");
   if(cp->hduset)
-    PRINTSTINGMAYBEWITHSPACE("hdu", cp->hdu);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("hdu", cp->hdu);
 
 
   /* 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");
-  PRINT_COMMONOPTIONS;
+  GAL_CONFIGFILES_PRINT_COMMONOPTIONS;
 }
 
 
@@ -171,10 +171,10 @@ checkifset(struct headerparams *p)
 
   int intro=0;
   if(cp->hduset==0)
-    REPORT_NOTSET("hdu");
+    GAL_CONFIGFILES_REPORT_NOTSET("hdu");
 
 
-  END_OF_NOTSET_REPORT;
+  GAL_CONFIGFILES_END_OF_NOTSET_REPORT;
 }
 
 
@@ -464,14 +464,14 @@ setparams(int argc, char *argv[], struct headerparams *p)
     error(EXIT_FAILURE, errno, "Parsing arguments");
 
   /* Add the user default values and save them if asked. */
-  CHECKSETCONFIG;
+  GAL_CONFIGFILES_CHECK_SET_CONFIG;
 
   /* Check if all the required parameters are set. */
   checkifset(p);
 
   /* Print the values for each parameter. */
   if(cp->printparams)
-    REPORT_PARAMETERS_SET;
+    GAL_CONFIGFILES_REPORT_PARAMETERS_SET;
 
   /* Do a sanity check. */
   sanitycheck(p);
diff --git a/src/imgcrop/args.h b/src/imgcrop/args.h
index 9fbbbea..06ace1e 100644
--- a/src/imgcrop/args.h
+++ b/src/imgcrop/args.h
@@ -45,7 +45,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 /* Definition parameters for the argp: */
-const char *argp_program_version=SPACK_STRING"\n"COPYRIGHT
+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[] = "[ASCIIcatalog] ASTRdata ...";
@@ -56,13 +56,13 @@ static char args_doc[] = "[ASCIIcatalog] ASTRdata ...";
 
 const char doc[] =
   /* Before the list of options: */
-  TOPHELPINFO
+  GAL_STRINGS_TOP_HELP_INFO
   SPACK_NAME" will create cutouts, thumbnails, postage stamps or crops of "
   "region(s) from input image(s) using image or celestial coordinates. "
   "If muliple crops are desired, a catalog must be provided. When in WCS "
   "mode, if the cut out covers more than one input image, all overlapping "
   "input images will be stitched in the output.\n"
-  MOREHELPINFO
+  GAL_STRINGS_MORE_HELP_INFO
   /* After the list of options: */
   "\v"
   PACKAGE_NAME" home page: "PACKAGE_URL;
diff --git a/src/imgcrop/cite.h b/src/imgcrop/cite.h
index 2054cdb..c57984c 100644
--- a/src/imgcrop/cite.h
+++ b/src/imgcrop/cite.h
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
           "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, GNUASTROBIBTEX,        \
+          SPACK_NAME, SPACK_NAME, SPACK_STRING, GAL_STRINGS_BIBTEX,    \
           IMGCROPBIBTEX);                                              \
     exit(EXIT_SUCCESS);                                                        
\
 }
diff --git a/src/imgcrop/crop.c b/src/imgcrop/crop.c
index 5fc7385..d6fac40 100644
--- a/src/imgcrop/crop.c
+++ b/src/imgcrop/crop.c
@@ -901,7 +901,7 @@ printlog(struct imgcropparams *p)
 {
   size_t i;
   FILE *logfile;
-  char msg[VERBMSGLENGTH_V];
+  char msg[GAL_TIMING_VERB_MSG_LENGTH_V];
   struct imgcroplog *log=p->log;
   size_t numfiles=0, numcentfilled=0, numstitched=0;
 
diff --git a/src/imgcrop/imgcrop.c b/src/imgcrop/imgcrop.c
index f4c84d2..9d9f165 100644
--- a/src/imgcrop/imgcrop.c
+++ b/src/imgcrop/imgcrop.c
@@ -53,7 +53,7 @@ imgmodecrop(void *inparam)
   int status;
   struct inputimgs *img;
   struct imgcroplog *log;
-  char msg[VERBMSGLENGTH_V];
+  char msg[GAL_TIMING_VERB_MSG_LENGTH_V];
 
   /* In image mode, we always only have one image. */
   crp->imgindex=0;
@@ -64,7 +64,7 @@ imgmodecrop(void *inparam)
   gal_fitsarray_read_fits_hdu(img->name, cp->hdu, IMAGE_HDU, &crp->infits);
 
   /* Go over all the outputs that are assigned to this thread: */
-  for(i=0;crp->indexs[i]!=NONTHRDINDEX;++i)
+  for(i=0;crp->indexs[i]!=GAL_THREADS_NON_THRD_INDEX;++i)
     {
       /* Set all the output parameters: */
       crp->outindex=crp->indexs[i];
@@ -136,10 +136,10 @@ wcsmodecrop(void *inparam)
   size_t i;
   int status, tcatset=0;
   struct imgcroplog *log;
-  char msg[VERBMSGLENGTH_V];
+  char msg[GAL_TIMING_VERB_MSG_LENGTH_V];
 
   /* Go over all the output objects for this thread. */
-  for(i=0;crp->indexs[i]!=NONTHRDINDEX;++i)
+  for(i=0;crp->indexs[i]!=GAL_THREADS_NON_THRD_INDEX;++i)
     {
       /* Set all the output parameters: */
       crp->outindex=crp->indexs[i];
@@ -310,7 +310,7 @@ imgcrop(struct imgcropparams *p)
 
       /* Spin off the threads: */
       for(i=0;i<nt;++i)
-       if(indexs[i*thrdcols]!=NONTHRDINDEX)
+       if(indexs[i*thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
          {
            crp[i].p=p;
            crp[i].b=&b;
diff --git a/src/imgcrop/ui.c b/src/imgcrop/ui.c
index 02656b3..7fac62b 100644
--- a/src/imgcrop/ui.c
+++ b/src/imgcrop/ui.c
@@ -96,7 +96,7 @@ readconfig(char *filename, struct imgcropparams *p)
   while(getline(&line, &len, fp) != -1)
     {
       /* Prepare the "name" and "value" strings, also set lineno. */
-      STARTREADINGLINE;
+      GAL_CONFIGFILES_START_READING_LINE;
 
       /* Operating modes: */
       if(strcmp(name, "imgmode")==0)
@@ -236,7 +236,7 @@ readconfig(char *filename, struct imgcropparams *p)
        }
 
       /* Read options common to all programs */
-      READ_COMMONOPTIONS_FROM_CONF
+      GAL_CONFIGFILES_READ_COMMONOPTIONS_FROM_CONF
 
       else
        error_at_line(EXIT_FAILURE, 0, filename, lineno,
@@ -261,7 +261,7 @@ printvalues(FILE *fp, struct imgcropparams *p)
      commented line explaining the options in that group. */
   fprintf(fp, "\n# Input image:\n");
   if(cp->hduset)
-    PRINTSTINGMAYBEWITHSPACE("hdu", cp->hdu);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("hdu", cp->hdu);
 
 
   fprintf(fp, "\n# Output parameters:\n");
@@ -296,7 +296,7 @@ printvalues(FILE *fp, struct imgcropparams *p)
      options, then the (possible options particular to this
      program). */
   fprintf(fp, "\n# Operating mode:\n");
-  PRINT_COMMONOPTIONS;
+  GAL_CONFIGFILES_PRINT_COMMONOPTIONS;
   if(up->imgmodeset)
     fprintf(fp, CONF_SHOWFMT"%d\n", "imgmode", p->imgmode);
   if(up->wcsmodeset)
@@ -318,27 +318,27 @@ checkifset(struct imgcropparams *p)
 
   int intro=0;
   if(up->imgmodeset==0 && up->wcsmodeset==0)
-    REPORT_NOTSET("imgmode or wcsmode");
+    GAL_CONFIGFILES_REPORT_NOTSET("imgmode or wcsmode");
   if(cp->hduset==0)
-    REPORT_NOTSET("hdu");
+    GAL_CONFIGFILES_REPORT_NOTSET("hdu");
   if(up->xcolset==0)
-    REPORT_NOTSET("xcol");
+    GAL_CONFIGFILES_REPORT_NOTSET("xcol");
   if(up->ycolset==0)
-    REPORT_NOTSET("ycol");
+    GAL_CONFIGFILES_REPORT_NOTSET("ycol");
   if(up->iwidthset==0)
-    REPORT_NOTSET("iwidth");
+    GAL_CONFIGFILES_REPORT_NOTSET("iwidth");
   if(up->racolset==0)
-    REPORT_NOTSET("racol");
+    GAL_CONFIGFILES_REPORT_NOTSET("racol");
   if(up->deccolset==0)
-    REPORT_NOTSET("deccol");
+    GAL_CONFIGFILES_REPORT_NOTSET("deccol");
   if(up->wwidthset==0)
-    REPORT_NOTSET("wwidth");
+    GAL_CONFIGFILES_REPORT_NOTSET("wwidth");
   if(up->suffixset==0)
-    REPORT_NOTSET("suffix");
+    GAL_CONFIGFILES_REPORT_NOTSET("suffix");
   if(up->checkcenterset==0)
-    REPORT_NOTSET("checkcenter");
+    GAL_CONFIGFILES_REPORT_NOTSET("checkcenter");
 
-  END_OF_NOTSET_REPORT;
+  GAL_CONFIGFILES_END_OF_NOTSET_REPORT;
 }
 
 
@@ -501,13 +501,13 @@ sanitycheck(struct imgcropparams *p)
         columns: */
       if(p->imgmode)
        {
-         CHECKCOLINCAT(p->xcol, "xcol");
-         CHECKCOLINCAT(p->ycol, "ycol");
+         GAL_CHECKSET_CHECK_COL_IN_CAT(p->xcol, "xcol");
+         GAL_CHECKSET_CHECK_COL_IN_CAT(p->ycol, "ycol");
        }
       else
        {
-         CHECKCOLINCAT(p->racol, "racol");
-         CHECKCOLINCAT(p->deccol, "deccol");
+         GAL_CHECKSET_CHECK_COL_IN_CAT(p->racol, "racol");
+         GAL_CHECKSET_CHECK_COL_IN_CAT(p->deccol, "deccol");
        }
     }
 
@@ -593,7 +593,7 @@ preparearrays(struct imgcropparams *p)
   fitsfile *tmpfits;
   struct timeval t1;
   struct inputimgs *img;
-  char msg[VERBMSGLENGTH_V];
+  char msg[GAL_TIMING_VERB_MSG_LENGTH_V];
   int i, status, firstbitpix=0;
 
   if(p->cp.verb) gettimeofday(&t1, NULL);
@@ -720,14 +720,14 @@ setparams(int argc, char *argv[], struct imgcropparams *p)
     error(EXIT_FAILURE, errno, "Parsing arguments");
 
   /* Add the user default values and save them if asked. */
-  CHECKSETCONFIG;
+  GAL_CONFIGFILES_CHECK_SET_CONFIG;
 
   /* Check if all the required parameters are set. */
   checkifset(p);
 
   /* Print the values for each parameter. */
   if(cp->printparams)
-    REPORT_PARAMETERS_SET;
+    GAL_CONFIGFILES_REPORT_PARAMETERS_SET;
 
   /* Read catalog if given. */
   if(p->up.catname)
@@ -747,7 +747,7 @@ setparams(int argc, char *argv[], struct imgcropparams *p)
 
   /* Do a sanity check. */
   sanitycheck(p);
-  gal_checkset_check_remove_file(TXTARRAYVVLOG, 0);
+  gal_checkset_check_remove_file(GAL_TXTARRAY_LOG, 0);
 
   /* Everything is ready, notify the user of the program starting. */
   if(cp->verb)
diff --git a/src/imgstat/args.h b/src/imgstat/args.h
index 0dfcd05..4cf52a2 100644
--- a/src/imgstat/args.h
+++ b/src/imgstat/args.h
@@ -46,7 +46,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 /* Definition parameters for the argp: */
-const char *argp_program_version=SPACK_STRING"\n"COPYRIGHT
+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";
@@ -57,11 +57,11 @@ static char args_doc[] = "ASTRdata";
 
 const char doc[] =
   /* Before the list of options: */
-  TOPHELPINFO
+  GAL_STRINGS_TOP_HELP_INFO
   SPACK_NAME" will print the basic statistics of the input image pixel "
   "flux distribution. All blank pixels or pixels specified by a mask "
   "image will be ignored.\n"
-  MOREHELPINFO
+  GAL_STRINGS_MORE_HELP_INFO
   /* After the list of options: */
   "\v"
   PACKAGE_NAME" home page: "PACKAGE_URL;
diff --git a/src/imgstat/cite.h b/src/imgstat/cite.h
index 708d7b3..a3bd373 100644
--- a/src/imgstat/cite.h
+++ b/src/imgstat/cite.h
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
           "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, GNUASTROBIBTEX,        \
+          SPACK_NAME, SPACK_NAME, SPACK_STRING, GAL_STRINGS_BIBTEX,    \
           HEADERBIBTEX);                                               \
     exit(EXIT_SUCCESS);                                                        
\
 }
diff --git a/src/imgstat/imgstat.c b/src/imgstat/imgstat.c
index e54be05..e70a791 100644
--- a/src/imgstat/imgstat.c
+++ b/src/imgstat/imgstat.c
@@ -70,7 +70,7 @@ reportsimplestats(struct imgstatparams *p)
   symvalue=gal_mode_value_from_sym(p->sorted, p->size, modeindex, modesym);
   printf("   -- %-45s%.4f   %g\n", "Mode symmetricity and its cutoff"
          " value", modesym, symvalue);
-  if(modesym<MODESYMGOOD)
+  if(modesym<GAL_MODE_SYM_GOOD)
     printf("      ## MODE SYMMETRICITY IS TOO LOW ##\n");
 
   /* Save the mode histogram and cumulative frequency plot. Note
diff --git a/src/imgstat/ui.c b/src/imgstat/ui.c
index ae5143a..0632b97 100644
--- a/src/imgstat/ui.c
+++ b/src/imgstat/ui.c
@@ -97,7 +97,7 @@ readconfig(char *filename, struct imgstatparams *p)
   while(getline(&line, &len, fp) != -1)
     {
       /* Prepare the "name" and "value" strings, also set lineno. */
-      STARTREADINGLINE;
+      GAL_CONFIGFILES_START_READING_LINE;
 
 
 
@@ -228,7 +228,7 @@ readconfig(char *filename, struct imgstatparams *p)
 
       /* Operating modes: */
       /* Read options common to all programs */
-      READ_COMMONOPTIONS_FROM_CONF
+      GAL_CONFIGFILES_READ_COMMONOPTIONS_FROM_CONF
 
 
       else
@@ -254,11 +254,11 @@ printvalues(FILE *fp, struct imgstatparams *p)
      commented line explaining the options in that group. */
   fprintf(fp, "\n# Input image:\n");
   if(cp->hduset)
-    PRINTSTINGMAYBEWITHSPACE("hdu", cp->hdu);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("hdu", cp->hdu);
   if(up->masknameset)
-    PRINTSTINGMAYBEWITHSPACE("mask", up->maskname);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("mask", up->maskname);
   if(up->mhdu)
-    PRINTSTINGMAYBEWITHSPACE("mhdu", up->mhdu);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("mhdu", up->mhdu);
   if(up->mirrordistset)
     fprintf(fp, CONF_SHOWFMT"%.2f\n", "mirrordist", p->mirrordist);
 
@@ -307,7 +307,7 @@ printvalues(FILE *fp, struct imgstatparams *p)
      options, then the (possible options particular to this
      program). */
   fprintf(fp, "\n# Operating mode:\n");
-  PRINT_COMMONOPTIONS;
+  GAL_CONFIGFILES_PRINT_COMMONOPTIONS;
 }
 
 
@@ -326,26 +326,26 @@ checkifset(struct imgstatparams *p)
 
   int intro=0;
   if(cp->hduset==0)
-    REPORT_NOTSET("hdu");
+    GAL_CONFIGFILES_REPORT_NOTSET("hdu");
   if(up->mirrordistset==0)
-    REPORT_NOTSET("mirrordist");
+    GAL_CONFIGFILES_REPORT_NOTSET("mirrordist");
   if(up->mirrorplotdistset==0)
-    REPORT_NOTSET("mirrorplotdist");
+    GAL_CONFIGFILES_REPORT_NOTSET("mirrorplotdist");
   if(up->onebinvalueset==0)
-    REPORT_NOTSET("onebinvalue");
+    GAL_CONFIGFILES_REPORT_NOTSET("onebinvalue");
   if(up->histnumbinsset==0)
-    REPORT_NOTSET("histnumbins");
+    GAL_CONFIGFILES_REPORT_NOTSET("histnumbins");
   if(up->cfpnumset==0)
-    REPORT_NOTSET("cfpnum");
+    GAL_CONFIGFILES_REPORT_NOTSET("cfpnum");
   if(up->sigclipmultipset==0)
-    REPORT_NOTSET("sigclipmultip");
+    GAL_CONFIGFILES_REPORT_NOTSET("sigclipmultip");
   if(up->sigcliptoleranceset==0)
-    REPORT_NOTSET("sigcliptolerance");
+    GAL_CONFIGFILES_REPORT_NOTSET("sigcliptolerance");
   if(up->sigclipnumset==0)
-    REPORT_NOTSET("sigclipnum");
+    GAL_CONFIGFILES_REPORT_NOTSET("sigclipnum");
 
 
-  END_OF_NOTSET_REPORT;
+  GAL_CONFIGFILES_END_OF_NOTSET_REPORT;
 }
 
 
@@ -516,19 +516,19 @@ preparearrays(struct imgstatparams *p)
             case 1:
               error(EXIT_FAILURE, 0, "The options `--histmin' (-i) and "
                     "`--histmax' (-x) should both be specified. You have "
-                    "only given the %s."HOWTOCHECKVALUES,
+                    "only given the %s."GAL_STRINGS_HOW_TO_CHECK_VALUES,
                     up->histminset==1 ? "former" : "latter");
               break;
             case 2:
               if(p->histmin>=p->histmax)
                 error(EXIT_FAILURE, 0, "The value to `--histmin' (-i) (%f) "
                       "is larger or equal to that of `--histmax' (-x) (%f)."
-                      HOWTOCHECKVALUES, p->histmin, p->histmax);
+                      GAL_STRINGS_HOW_TO_CHECK_VALUES, p->histmin, p->histmax);
               if(p->histmin>p->sorted[p->size-1] || p->histmax<p->sorted[0])
                 error(EXIT_FAILURE, 0, "The range of data is %.5f to %.5f. "
                       "However, you have set `--histmin' (-i) and "
                       "`--histmax' (-x) to %.5f and %.5f respectively. "
-                      "They do not overlap!"HOWTOCHECKVALUES,
+                      "They do not overlap!"GAL_STRINGS_HOW_TO_CHECK_VALUES,
                       p->sorted[0], p->sorted[p->size-1], p->histmin,
                       p->histmax);
               break;
@@ -571,19 +571,19 @@ preparearrays(struct imgstatparams *p)
             case 1:
               error(EXIT_FAILURE, 0, "The options `--cfpmin' (-a) and "
                     "`--cfpmax' (-b) should both be specified. You have "
-                    "only given the %s."HOWTOCHECKVALUES,
+                    "only given the %s."GAL_STRINGS_HOW_TO_CHECK_VALUES,
                     up->cfpminset==1 ? "former" : "latter");
               break;
             case 2:
               if(p->cfpmin>p->cfpmax)
                 error(EXIT_FAILURE, 0, "The value to `--cfpmin' (-a) (%.f) "
                       "is larger than that of `--cfpmax' (-b) (%f)."
-                      HOWTOCHECKVALUES, p->cfpmin, p->cfpmax);
+                      GAL_STRINGS_HOW_TO_CHECK_VALUES, p->cfpmin, p->cfpmax);
               if(p->cfpmin>p->sorted[p->size-1] || p->cfpmax<p->sorted[0])
                 error(EXIT_FAILURE, 0, "The range of data is %.5f to %.5f. "
                       "However, you have set `--cfpmin' (-a) and "
                       "`--cfpmax' (-b) to %.5f and %.5f respectively. "
-                      "They do not overlap!"HOWTOCHECKVALUES,
+                      "They do not overlap!"GAL_STRINGS_HOW_TO_CHECK_VALUES,
                       p->sorted[0], p->sorted[p->size-1], p->cfpmin,
                       p->cfpmax);
               break;
@@ -642,14 +642,14 @@ setparams(int argc, char *argv[], struct imgstatparams *p)
     error(EXIT_FAILURE, errno, "Parsing arguments");
 
   /* Add the user default values and save them if asked. */
-  CHECKSETCONFIG;
+  GAL_CONFIGFILES_CHECK_SET_CONFIG;
 
   /* Check if all the required parameters are set. */
   checkifset(p);
 
   /* Print the values for each parameter. */
   if(cp->printparams)
-    REPORT_PARAMETERS_SET;
+    GAL_CONFIGFILES_REPORT_PARAMETERS_SET;
 
   /* Do a sanity check. */
   sanitycheck(p);
diff --git a/src/imgwarp/args.h b/src/imgwarp/args.h
index 2fc18e4..71df003 100644
--- a/src/imgwarp/args.h
+++ b/src/imgwarp/args.h
@@ -45,7 +45,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 /* Definition parameters for the argp: */
-const char *argp_program_version=SPACK_STRING"\n"COPYRIGHT
+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[] = "[matrix.txt] ASTRdata ...";
@@ -56,11 +56,11 @@ static char args_doc[] = "[matrix.txt] ASTRdata ...";
 
 const char doc[] =
   /* Before the list of options: */
-  TOPHELPINFO
+  GAL_STRINGS_TOP_HELP_INFO
   SPACK_NAME" will warp/transform the input image using an input coordinate "
   "matrix. Currently it accepts any general projective mapping (which "
   "includes affine mappings as a subset). \n"
-  MOREHELPINFO
+  GAL_STRINGS_MORE_HELP_INFO
   /* After the list of options: */
   "\v"
   PACKAGE_NAME" home page: "PACKAGE_URL;
diff --git a/src/imgwarp/cite.h b/src/imgwarp/cite.h
index bbad19c..8a2279f 100644
--- a/src/imgwarp/cite.h
+++ b/src/imgwarp/cite.h
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
           "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, GNUASTROBIBTEX,        \
+          SPACK_NAME, SPACK_NAME, SPACK_STRING, GAL_STRINGS_BIBTEX,    \
           IMGCROPBIBTEX);                                              \
     exit(EXIT_SUCCESS);                                                        
\
 }
diff --git a/src/imgwarp/imgwarp.c b/src/imgwarp/imgwarp.c
index d655f31..c6d6e8a 100644
--- a/src/imgwarp/imgwarp.c
+++ b/src/imgwarp/imgwarp.c
@@ -66,7 +66,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
    nearestint_halfhigher(0.5f) --> 1.0f
 */
 #define nearestint_halfhigher(D)                                        \
-  ( ceil((D)) - (D) > 0.5f + ROUNDERR ? ceil((D))-1.0f : ceil((D)) )
+  (ceil((D)) - (D) > 0.5f + GAL_POLYGON_ROUND_ERR ? ceil((D))-1.0f : ceil((D)))
 
 
 
@@ -77,14 +77,14 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
    nearestint_halflower(0.5f) --> 0.0f;
  */
 #define nearestint_halflower(D)                                        \
-  ( ceil((D)) - (D) > 0.5f - ROUNDERR ? ceil((D))-1.0f : ceil((D)) )
+  (ceil((D)) - (D) > 0.5f - GAL_POLYGON_ROUND_ERR ? ceil((D))-1.0f : ceil((D)))
 
 
 
 
 
-#define ceilwitherr(D)                          \
-  ( fabs( nearbyint((D)) - (D) ) < ROUNDERR     \
+#define ceilwitherr(D)                                       \
+  ( fabs( nearbyint((D)) - (D) ) < GAL_POLYGON_ROUND_ERR     \
     ? nearbyint((D)) : nearbyint((D))+1  )
 
 
@@ -121,9 +121,9 @@ imgwarponthread(void *inparam)
   size_t i, j, ind, os1=p->onaxes[0], numcrn, numinput;
   double ocrn[8], icrn_base[8], icrn[8], *output=p->output;
   long x, y, xstart, xend, ystart, yend; /* Might be negative */
-  double pcrn[8], *outfpixval=p->outfpixval, ccrn[MAXPOLYGONCORNERS];
+  double pcrn[8], *outfpixval=p->outfpixval, ccrn[GAL_POLYGON_MAX_CORNERS];
 
-  for(i=0;(ind=iwp->indexs[i])!=NONTHRDINDEX;++i)
+  for(i=0;(ind=iwp->indexs[i])!=GAL_THREADS_NON_THRD_INDEX;++i)
     {
       /* Initialize the output pixel value: */
       numinput=0;
@@ -554,7 +554,7 @@ imgwarp(struct imgwarpparams *p)
 
       /* Spin off the threads: */
       for(i=0;i<nt;++i)
-        if(indexs[i*thrdcols]!=NONTHRDINDEX)
+        if(indexs[i*thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
           {
             iwp[i].p=p;
             iwp[i].b=&b;
diff --git a/src/imgwarp/ui.c b/src/imgwarp/ui.c
index ff5010b..fb4d98d 100644
--- a/src/imgwarp/ui.c
+++ b/src/imgwarp/ui.c
@@ -92,7 +92,7 @@ readconfig(char *filename, struct imgwarpparams *p)
   while(getline(&line, &len, fp) != -1)
     {
       /* Prepare the "name" and "value" strings, also set lineno. */
-      STARTREADINGLINE;
+      GAL_CONFIGFILES_START_READING_LINE;
 
 
 
@@ -140,7 +140,7 @@ readconfig(char *filename, struct imgwarpparams *p)
 
       /* Operating modes: */
       /* Read options common to all programs */
-      READ_COMMONOPTIONS_FROM_CONF
+      GAL_CONFIGFILES_READ_COMMONOPTIONS_FROM_CONF
 
 
       else
@@ -166,7 +166,7 @@ printvalues(FILE *fp, struct imgwarpparams *p)
      commented line explaining the options in that group. */
   fprintf(fp, "\n# Input image:\n");
   if(cp->hduset)
-    PRINTSTINGMAYBEWITHSPACE("hdu", cp->hdu);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("hdu", cp->hdu);
   if(up->hstartwcsset)
     fprintf(fp, CONF_SHOWFMT"%lu\n", "hstartwcs", p->hstartwcs);
   if(up->hendwcsset)
@@ -174,10 +174,10 @@ printvalues(FILE *fp, struct imgwarpparams *p)
 
   fprintf(fp, "\n# Output parameters:\n");
   if(up->matrixstringset)
-    PRINTSTINGMAYBEWITHSPACE("matrix", up->matrixstring);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("matrix", up->matrixstring);
 
   if(cp->outputset)
-    PRINTSTINGMAYBEWITHSPACE("output", cp->output);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("output", cp->output);
 
   if(up->maxblankfracset)
     fprintf(fp, CONF_SHOWFMT"%.3f\n", "maxblankfrac", p->maxblankfrac);
@@ -187,7 +187,7 @@ printvalues(FILE *fp, struct imgwarpparams *p)
      options, then the (possible options particular to this
      program). */
   fprintf(fp, "\n# Operating mode:\n");
-  PRINT_COMMONOPTIONS;
+  GAL_CONFIGFILES_PRINT_COMMONOPTIONS;
 }
 
 
@@ -205,13 +205,13 @@ checkifset(struct imgwarpparams *p)
 
   int intro=0;
   if(cp->hduset==0)
-    REPORT_NOTSET("hdu");
+    GAL_CONFIGFILES_REPORT_NOTSET("hdu");
   if(up->matrixstringset==0)
-    REPORT_NOTSET("matrix");
+    GAL_CONFIGFILES_REPORT_NOTSET("matrix");
   if(up->maxblankfracset==0)
-    REPORT_NOTSET("maxblankfrac");
+    GAL_CONFIGFILES_REPORT_NOTSET("maxblankfrac");
 
-  END_OF_NOTSET_REPORT;
+  GAL_CONFIGFILES_END_OF_NOTSET_REPORT;
 }
 
 
@@ -483,14 +483,14 @@ setparams(int argc, char *argv[], struct imgwarpparams *p)
     error(EXIT_FAILURE, errno, "Parsing arguments");
 
   /* Add the user default values and save them if asked. */
-  CHECKSETCONFIG;
+  GAL_CONFIGFILES_CHECK_SET_CONFIG;
 
   /* Check if all the required parameters are set. */
   checkifset(p);
 
   /* Print the values for each parameter. */
   if(cp->printparams)
-    REPORT_PARAMETERS_SET;
+    GAL_CONFIGFILES_REPORT_PARAMETERS_SET;
 
   /* Read catalog if given. */
   if(p->up.matrixname)
@@ -500,7 +500,7 @@ setparams(int argc, char *argv[], struct imgwarpparams *p)
 
   /* Do a sanity check. */
   sanitycheck(p);
-  gal_checkset_check_remove_file(TXTARRAYVVLOG, 0);
+  gal_checkset_check_remove_file(GAL_TXTARRAY_LOG, 0);
 
   /* Everything is ready, notify the user of the program starting. */
   if(cp->verb)
diff --git a/src/mkcatalog/args.h b/src/mkcatalog/args.h
index 03270e4..a5959c2 100644
--- a/src/mkcatalog/args.h
+++ b/src/mkcatalog/args.h
@@ -46,7 +46,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 /* Definition parameters for the argp: */
-const char *argp_program_version=SPACK_STRING"\n"COPYRIGHT
+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";
@@ -57,10 +57,10 @@ static char args_doc[] = "ASTRdata";
 
 const char doc[] =
   /* Before the list of options: */
-  TOPHELPINFO
+  GAL_STRINGS_TOP_HELP_INFO
   SPACK_NAME" will create a catalog from an input, labeled, and noise "
   "identification images.\n"
-  MOREHELPINFO
+  GAL_STRINGS_MORE_HELP_INFO
   /* After the list of options: */
   "\v"
   PACKAGE_NAME" home page: "PACKAGE_URL;
diff --git a/src/mkcatalog/cite.h b/src/mkcatalog/cite.h
index 96c425e..0b5f0f3 100644
--- a/src/mkcatalog/cite.h
+++ b/src/mkcatalog/cite.h
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
           "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, GNUASTROBIBTEX,        \
+          SPACK_NAME, SPACK_NAME, SPACK_STRING, GAL_STRINGS_BIBTEX,    \
           HEADERBIBTEX);                                               \
     exit(EXIT_SUCCESS);                                                        
\
 }
diff --git a/src/mkcatalog/mkcatalog.c b/src/mkcatalog/mkcatalog.c
index 2f810a2..a3a8663 100644
--- a/src/mkcatalog/mkcatalog.c
+++ b/src/mkcatalog/mkcatalog.c
@@ -45,12 +45,12 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 /* Macro to see if the label is indexable (belongs to an object or
    not). See the explanation in src/noisechisel/label.h. */
-#if FITSLONGBLANK<0
+#if GAL_FITSARRAY_LONG_BLANK<0
 #define ISINDEXABLEOBJLABEL (objects[i]>0)
 #define ISINDEXABLECLPLABEL (clumps[i]>0)
 #else
-#define ISINDEXABLEOBJLABEL (objects[i] && objects[i]!=FITSLONGBLANK)
-#define ISINDEXABLECLPLABEL (clumps[i] && clumps[i]!=FITSLONGBLANK)
+#define ISINDEXABLEOBJLABEL (objects[i] && 
objects[i]!=GAL_FITSARRAY_LONG_BLANK)
+#define ISINDEXABLECLPLABEL (clumps[i] && clumps[i]!=GAL_FITSARRAY_LONG_BLANK)
 #endif
 
 
@@ -228,7 +228,7 @@ secondpass(struct mkcatalogparams *p)
       /* We are on a detected region but not a clump (with a negative
          label). This region can be used to find properties like the
          river fluxs in the vicinity of clumps. */
-      else if (clumps[i]!=FITSLONGBLANK)
+      else if (clumps[i]!=GAL_FITSARRAY_LONG_BLANK)
 
         /* We want to check the river pixels in each detection that
            has a clump. Recall that each detection can host more than
@@ -254,7 +254,7 @@ secondpass(struct mkcatalogparams *p)
             /* Make the preparations: */
             ii=0;
             ind=&i;
-            FILL_NGB_8_ALLIMG;
+            GAL_NEIGHBORS_FILL_8_ALLIMG;
             nf=(n=ngb)+numngb;
             memset(wngb, 0, sizeof(wngb));
 
diff --git a/src/mkcatalog/ui.c b/src/mkcatalog/ui.c
index b0d12a4..ff15ca0 100644
--- a/src/mkcatalog/ui.c
+++ b/src/mkcatalog/ui.c
@@ -94,7 +94,7 @@ readconfig(char *filename, struct mkcatalogparams *p)
   while(getline(&line, &len, fp) != -1)
     {
       /* Prepare the "name" and "value" strings, also set lineno. */
-      STARTREADINGLINE;
+      GAL_CONFIGFILES_START_READING_LINE;
 
 
 
@@ -400,7 +400,7 @@ readconfig(char *filename, struct mkcatalogparams *p)
 
       /* Operating modes */
       /* Read options common to all programs */
-      READ_COMMONOPTIONS_FROM_CONF
+      GAL_CONFIGFILES_READ_COMMONOPTIONS_FROM_CONF
 
 
       else
@@ -428,27 +428,27 @@ printvalues(FILE *fp, struct mkcatalogparams *p)
      commented line explaining the options in that group. */
   fprintf(fp, "\n# Input image:\n");
   if(cp->hduset)
-    PRINTSTINGMAYBEWITHSPACE("hdu", cp->hdu);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("hdu", cp->hdu);
   if(up->masknameset)
-    PRINTSTINGMAYBEWITHSPACE("mask", up->maskname);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("mask", up->maskname);
   if(up->mhduset)
-    PRINTSTINGMAYBEWITHSPACE("mhdu", up->mhdu);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("mhdu", up->mhdu);
   if(up->objlabsnameset)
-    PRINTSTINGMAYBEWITHSPACE("objlabs", up->objlabsname);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("objlabs", up->objlabsname);
   if(up->objhduset)
-    PRINTSTINGMAYBEWITHSPACE("objhdu", up->objhdu);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("objhdu", up->objhdu);
   if(up->clumplabsnameset)
-    PRINTSTINGMAYBEWITHSPACE("clumplabs", up->clumplabsname);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("clumplabs", up->clumplabsname);
   if(up->clumphduset)
-    PRINTSTINGMAYBEWITHSPACE("clumphdu", up->clumphdu);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("clumphdu", up->clumphdu);
   if(up->skynameset)
-    PRINTSTINGMAYBEWITHSPACE("skyfilename", up->skyname);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("skyfilename", up->skyname);
   if(up->skyhduset)
-    PRINTSTINGMAYBEWITHSPACE("skyhdu", up->skyhdu);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("skyhdu", up->skyhdu);
   if(up->stdnameset)
-    PRINTSTINGMAYBEWITHSPACE("stdfilename", up->stdname);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("stdfilename", up->stdname);
   if(up->stdhduset)
-    PRINTSTINGMAYBEWITHSPACE("stdhdu", up->stdhdu);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("stdhdu", up->stdhdu);
   if(up->zeropointset)
     fprintf(fp, CONF_SHOWFMT"%.3f\n", "zeropoint", p->zeropoint);
   if(up->skysubtractedset)
@@ -457,7 +457,7 @@ printvalues(FILE *fp, struct mkcatalogparams *p)
   /* Output: */
   fprintf(fp, "\n# Output:\n");
   if(cp->outputset)
-    PRINTSTINGMAYBEWITHSPACE("output", cp->output);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("output", cp->output);
   if(up->nsigmagset)
     fprintf(fp, CONF_SHOWFMT"%g\n", "nsigmag", p->nsigmag);
   if(up->intwidthset)
@@ -558,7 +558,7 @@ printvalues(FILE *fp, struct mkcatalogparams *p)
      options, then the (possible options particular to this
      program). */
   fprintf(fp, "\n# Operating mode:\n");
-  PRINT_COMMONOPTIONS;
+  GAL_CONFIGFILES_PRINT_COMMONOPTIONS;
 }
 
 
@@ -576,35 +576,35 @@ checkifset(struct mkcatalogparams *p)
 
   int intro=0;
   if(cp->hduset==0)
-    REPORT_NOTSET("hdu");
+    GAL_CONFIGFILES_REPORT_NOTSET("hdu");
   if(up->objhduset==0)
-    REPORT_NOTSET("objhdu");
+    GAL_CONFIGFILES_REPORT_NOTSET("objhdu");
   if(up->clumphduset==0)
-    REPORT_NOTSET("clumphdu");
+    GAL_CONFIGFILES_REPORT_NOTSET("clumphdu");
   if(up->skyhduset==0)
-    REPORT_NOTSET("skyhdu");
+    GAL_CONFIGFILES_REPORT_NOTSET("skyhdu");
   if(up->stdhduset==0)
-    REPORT_NOTSET("stdhdu");
+    GAL_CONFIGFILES_REPORT_NOTSET("stdhdu");
   if(up->zeropointset==0)
-    REPORT_NOTSET("zeropoint");
+    GAL_CONFIGFILES_REPORT_NOTSET("zeropoint");
   if(up->skysubtractedset==0)
-    REPORT_NOTSET("skysubtracted");
+    GAL_CONFIGFILES_REPORT_NOTSET("skysubtracted");
 
   /* Output: */
   if(up->nsigmagset==0)
-    REPORT_NOTSET("nsigmag");
+    GAL_CONFIGFILES_REPORT_NOTSET("nsigmag");
   if(up->intwidthset==0)
-    REPORT_NOTSET("intwidth");
+    GAL_CONFIGFILES_REPORT_NOTSET("intwidth");
   if(up->floatwidthset==0)
-    REPORT_NOTSET("floatwidth");
+    GAL_CONFIGFILES_REPORT_NOTSET("floatwidth");
   if(up->accuwidthset==0)
-    REPORT_NOTSET("accuwidth");
+    GAL_CONFIGFILES_REPORT_NOTSET("accuwidth");
   if(up->floatprecisionset==0)
-    REPORT_NOTSET("floatprecision");
+    GAL_CONFIGFILES_REPORT_NOTSET("floatprecision");
   if(up->accuprecisionset==0)
-    REPORT_NOTSET("accuprecision");
+    GAL_CONFIGFILES_REPORT_NOTSET("accuprecision");
 
-  END_OF_NOTSET_REPORT;
+  GAL_CONFIGFILES_END_OF_NOTSET_REPORT;
 }
 
 
@@ -977,7 +977,7 @@ setparams(int argc, char *argv[], struct mkcatalogparams *p)
 
 
   /* Add the user default values and save them if asked. */
-  CHECKSETCONFIG;
+  GAL_CONFIGFILES_CHECK_SET_CONFIG;
 
   /* Check if all the required parameters are set. */
   checkifset(p);
@@ -995,7 +995,7 @@ setparams(int argc, char *argv[], struct mkcatalogparams *p)
 
   /* Print the values for each parameter. */
   if(cp->printparams)
-    REPORT_PARAMETERS_SET;
+    GAL_CONFIGFILES_REPORT_PARAMETERS_SET;
 
   /* Everything is ready, notify the user of the program starting. */
   if(cp->verb)
diff --git a/src/mknoise/args.h b/src/mknoise/args.h
index 70a538d..f9f945c 100644
--- a/src/mknoise/args.h
+++ b/src/mknoise/args.h
@@ -45,7 +45,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 /* Definition parameters for the argp: */
-const char *argp_program_version=SPACK_STRING"\n"COPYRIGHT
+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 ...";
@@ -56,10 +56,10 @@ static char args_doc[] = "ASTRdata ...";
 
 const char doc[] =
   /* Before the list of options: */
-  TOPHELPINFO
+  GAL_STRINGS_TOP_HELP_INFO
   SPACK_NAME" will add noise to all the pixels in an input image. The noise "
   "parameters can be specified with the command line options. \n"
-  MOREHELPINFO
+  GAL_STRINGS_MORE_HELP_INFO
   /* After the list of options: */
   "\v"
   PACKAGE_NAME" home page: "PACKAGE_URL;
diff --git a/src/mknoise/cite.h b/src/mknoise/cite.h
index b6bfe97..15b0f27 100644
--- a/src/mknoise/cite.h
+++ b/src/mknoise/cite.h
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
           "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, GNUASTROBIBTEX,        \
+          SPACK_NAME, SPACK_NAME, SPACK_STRING, GAL_STRINGS_BIBTEX,    \
           IMGCROPBIBTEX);                                              \
     exit(EXIT_SUCCESS);                                                        
\
 }
diff --git a/src/mknoise/ui.c b/src/mknoise/ui.c
index bf5d8aa..a257a6e 100644
--- a/src/mknoise/ui.c
+++ b/src/mknoise/ui.c
@@ -93,7 +93,7 @@ readconfig(char *filename, struct mknoiseparams *p)
   while(getline(&line, &len, fp) != -1)
     {
       /* Prepare the "name" and "value" strings, also set lineno. */
-      STARTREADINGLINE;
+      GAL_CONFIGFILES_START_READING_LINE;
 
 
 
@@ -134,7 +134,7 @@ readconfig(char *filename, struct mknoiseparams *p)
 
       /* Operating modes: */
       /* Read options common to all programs */
-      READ_COMMONOPTIONS_FROM_CONF
+      GAL_CONFIGFILES_READ_COMMONOPTIONS_FROM_CONF
 
 
       else
@@ -160,7 +160,7 @@ printvalues(FILE *fp, struct mknoiseparams *p)
      commented line explaining the options in that group. */
   fprintf(fp, "\n# Input image:\n");
   if(cp->hduset)
-    PRINTSTINGMAYBEWITHSPACE("hdu", cp->hdu);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("hdu", cp->hdu);
   if(up->backgroundset)
     fprintf(fp, CONF_SHOWFMT"%f\n", "background", p->mbackground);
   if(up->zeropointset)
@@ -178,7 +178,7 @@ printvalues(FILE *fp, struct mknoiseparams *p)
      options, then the (possible options particular to this
      program). */
   fprintf(fp, "\n# Operating mode:\n");
-  PRINT_COMMONOPTIONS;
+  GAL_CONFIGFILES_PRINT_COMMONOPTIONS;
 }
 
 
@@ -196,17 +196,17 @@ checkifset(struct mknoiseparams *p)
 
   int intro=0;
   if(cp->hduset==0)
-    REPORT_NOTSET("hdu");
+    GAL_CONFIGFILES_REPORT_NOTSET("hdu");
 
   if(up->backgroundset==0)
-    REPORT_NOTSET("background");
+    GAL_CONFIGFILES_REPORT_NOTSET("background");
   if(up->zeropointset==0)
-    REPORT_NOTSET("zeropoint");
+    GAL_CONFIGFILES_REPORT_NOTSET("zeropoint");
   if(up->stdaddset==0)
-    REPORT_NOTSET("stdadd");
+    GAL_CONFIGFILES_REPORT_NOTSET("stdadd");
 
 
-  END_OF_NOTSET_REPORT;
+  GAL_CONFIGFILES_END_OF_NOTSET_REPORT;
 }
 
 
@@ -327,7 +327,7 @@ preparearrays(struct mknoiseparams *p)
 void
 setparams(int argc, char *argv[], struct mknoiseparams *p)
 {
-  char message[VERBMSGLENGTH_V];
+  char message[GAL_TIMING_VERB_MSG_LENGTH_V];
   struct commonparams *cp=&p->cp;
 
   /* Set the non-zero initial values, the structure was initialized to
@@ -343,14 +343,14 @@ setparams(int argc, char *argv[], struct mknoiseparams *p)
     error(EXIT_FAILURE, errno, "Parsing arguments");
 
   /* Add the user default values and save them if asked. */
-  CHECKSETCONFIG;
+  GAL_CONFIGFILES_CHECK_SET_CONFIG;
 
   /* Check if all the required parameters are set. */
   checkifset(p);
 
   /* Print the values for each parameter. */
   if(cp->printparams)
-    REPORT_PARAMETERS_SET;
+    GAL_CONFIGFILES_REPORT_PARAMETERS_SET;
 
   /* Make the array of input images. */
   preparearrays(p);
diff --git a/src/mkprof/args.h b/src/mkprof/args.h
index 8a5a97b..608188b 100644
--- a/src/mkprof/args.h
+++ b/src/mkprof/args.h
@@ -31,7 +31,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 /* Definition parameters for the argp: */
-const char *argp_program_version=SPACK_STRING"\n"COPYRIGHT
+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[] = "[BackgroundImage] Catalog";
@@ -42,13 +42,13 @@ static char args_doc[] = "[BackgroundImage] Catalog";
 
 const char doc[] =
   /* Before the list of options: */
-  TOPHELPINFO
+  GAL_STRINGS_TOP_HELP_INFO
   SPACK_NAME" will create a FITS image containing any number of mock "
   "astronomical profiles based on an input catalog. All the profiles "
   "will be built from the center outwards. First by Monte Carlo "
   "integration, then using the central pixel position. The tolerance "
   "level specifies when to switch to a latter.\n"
-  MOREHELPINFO
+  GAL_STRINGS_MORE_HELP_INFO
   /* After the list of options: */
   "\v"
   PACKAGE_NAME" home page: "PACKAGE_URL;
diff --git a/src/mkprof/cite.h b/src/mkprof/cite.h
index 2b8a9f9..e844d0b 100644
--- a/src/mkprof/cite.h
+++ b/src/mkprof/cite.h
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
           "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, GNUASTROBIBTEX,        \
+          SPACK_NAME, SPACK_NAME, SPACK_STRING, GAL_STRINGS_BIBTEX,    \
           MKPROFBIBTEX);                                               \
     exit(EXIT_SUCCESS);                                                        
\
 }
diff --git a/src/mkprof/mkprof.c b/src/mkprof/mkprof.c
index e265ebe..be2f027 100644
--- a/src/mkprof/mkprof.c
+++ b/src/mkprof/mkprof.c
@@ -310,7 +310,7 @@ build(void *inparam)
   pthread_cond_t *qready=&p->qready;
 
   /* Make each profile that was specified for this thread. */
-  for(i=0;mkp->indexs[i]!=NONTHRDINDEX;++i)
+  for(i=0;mkp->indexs[i]!=GAL_THREADS_NON_THRD_INDEX;++i)
     {
       /* Create a new builtqueue element with all the information. fbq
         will be used when we want to add ibq to p->bq. It is defined
@@ -408,7 +408,7 @@ build(void *inparam)
              this thread to add up its built profiles). So we have to
              lock the mutex to pass on this built structure to the
              builtqueue. */
-          else if (mkp->indexs[i+1]==NONTHRDINDEX)
+          else if (mkp->indexs[i+1]==GAL_THREADS_NON_THRD_INDEX)
             {
              pthread_mutex_lock(qlock);
              fbq->next=p->bq;
@@ -731,7 +731,7 @@ mkprof(struct mkprofparams *p)
 
       /* Spin off the threads: */
       for(i=0;i<nt;++i)
-       if(indexs[i*thrdcols]!=NONTHRDINDEX)
+       if(indexs[i*thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
          {
            mkp[i].p=p;
            mkp[i].b=&b;
diff --git a/src/mkprof/oneprofile.c b/src/mkprof/oneprofile.c
index ff7849c..8712dd7 100644
--- a/src/mkprof/oneprofile.c
+++ b/src/mkprof/oneprofile.c
@@ -316,7 +316,7 @@ makepixbypix(struct mkonthread *mkp)
 
           /* Go over the neighbours and add them to queue of elements
              to check. */
-          FILL_NGB_4_ALLIMG;
+          GAL_NEIGHBORS_FILL_4_ALLIMG;
           nf=(n=ngb)+numngb;
           do
             if(byt[*n]==0)
@@ -365,7 +365,7 @@ makepixbypix(struct mkonthread *mkp)
       */
       /* Go over the neighbours and add them to queue of elements
         to check. */
-      FILL_NGB_4_ALLIMG;
+      GAL_NEIGHBORS_FILL_4_ALLIMG;
       nf=(n=ngb)+numngb;
       do
        if(byt[*n]==0)
diff --git a/src/mkprof/ui.c b/src/mkprof/ui.c
index 5f3341d..1638d18 100644
--- a/src/mkprof/ui.c
+++ b/src/mkprof/ui.c
@@ -93,7 +93,7 @@ readconfig(char *filename, struct mkprofparams *p)
   while(getline(&line, &len, fp) != -1)
     {
       /* Prepare the "name" and "value" strings, also set lineno. */
-      STARTREADINGLINE;
+      GAL_CONFIGFILES_START_READING_LINE;
 
       /* Inputs: */
       if(strcmp(name, "hdu")==0)
@@ -303,7 +303,7 @@ readconfig(char *filename, struct mkprofparams *p)
 
       /* Operating modes: */
       /* Read options common to all programs */
-      READ_COMMONOPTIONS_FROM_CONF
+      GAL_CONFIGFILES_READ_COMMONOPTIONS_FROM_CONF
 
 
       else
@@ -328,7 +328,7 @@ printvalues(FILE *fp, struct mkprofparams *p)
 
   fprintf(fp, "\n# Input:\n");
   if(cp->hduset)
-    PRINTSTINGMAYBEWITHSPACE("hdu", cp->hdu);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("hdu", cp->hdu);
 
   fprintf(fp, "\n# Output:\n");
   if(cp->outputset)
@@ -388,7 +388,7 @@ printvalues(FILE *fp, struct mkprofparams *p)
      options, then the (possible options particular to this
      program). */
   fprintf(fp, "\n# Operating modes:\n");
-  PRINT_COMMONOPTIONS;
+  GAL_CONFIGFILES_PRINT_COMMONOPTIONS;
 }
 
 
@@ -402,50 +402,50 @@ checkifset(struct mkprofparams *p)
 
   int intro=0;
   if(p->cp.hduset==0)
-    REPORT_NOTSET("hdu");
+    GAL_CONFIGFILES_REPORT_NOTSET("hdu");
   if(up->tunitinpset==0)
-    REPORT_NOTSET("tunitinp");
+    GAL_CONFIGFILES_REPORT_NOTSET("tunitinp");
   if(up->numrandomset==0)
-    REPORT_NOTSET("numrandom");
+    GAL_CONFIGFILES_REPORT_NOTSET("numrandom");
   if(up->toleranceset==0)
-    REPORT_NOTSET("tolerance");
+    GAL_CONFIGFILES_REPORT_NOTSET("tolerance");
   if(up->zeropointset==0)
-    REPORT_NOTSET("zeropoint");
+    GAL_CONFIGFILES_REPORT_NOTSET("zeropoint");
   if(up->xcolset==0)
-    REPORT_NOTSET("xcol");
+    GAL_CONFIGFILES_REPORT_NOTSET("xcol");
   if(up->ycolset==0)
-    REPORT_NOTSET("ycol");
+    GAL_CONFIGFILES_REPORT_NOTSET("ycol");
   if(up->fcolset==0)
-    REPORT_NOTSET("fcol");
+    GAL_CONFIGFILES_REPORT_NOTSET("fcol");
   if(up->rcolset==0)
-    REPORT_NOTSET("rcol");
+    GAL_CONFIGFILES_REPORT_NOTSET("rcol");
   if(up->ncolset==0)
-    REPORT_NOTSET("ncol");
+    GAL_CONFIGFILES_REPORT_NOTSET("ncol");
   if(up->pcolset==0)
-    REPORT_NOTSET("pcol");
+    GAL_CONFIGFILES_REPORT_NOTSET("pcol");
   if(up->qcolset==0)
-    REPORT_NOTSET("qcol");
+    GAL_CONFIGFILES_REPORT_NOTSET("qcol");
   if(up->mcolset==0)
-    REPORT_NOTSET("mcol");
+    GAL_CONFIGFILES_REPORT_NOTSET("mcol");
   if(up->naxis1set==0)
-    REPORT_NOTSET("naxis1");
+    GAL_CONFIGFILES_REPORT_NOTSET("naxis1");
   if(up->naxis2set==0)
-    REPORT_NOTSET("naxis2");
+    GAL_CONFIGFILES_REPORT_NOTSET("naxis2");
   if(up->oversampleset==0)
-    REPORT_NOTSET("oversample");
+    GAL_CONFIGFILES_REPORT_NOTSET("oversample");
   if(up->circumwidthset==0)
-    REPORT_NOTSET("circumwidth");
+    GAL_CONFIGFILES_REPORT_NOTSET("circumwidth");
   if(up->crpix1set==0)
-    REPORT_NOTSET("crpix1");
+    GAL_CONFIGFILES_REPORT_NOTSET("crpix1");
   if(up->crpix2set==0)
-    REPORT_NOTSET("crpix2");
+    GAL_CONFIGFILES_REPORT_NOTSET("crpix2");
   if(up->crval1set==0)
-    REPORT_NOTSET("crval1");
+    GAL_CONFIGFILES_REPORT_NOTSET("crval1");
   if(up->crval2set==0)
-    REPORT_NOTSET("crval2");
+    GAL_CONFIGFILES_REPORT_NOTSET("crval2");
   if(up->resolutionset==0)
-    REPORT_NOTSET("resolution");
-  END_OF_NOTSET_REPORT;
+    GAL_CONFIGFILES_REPORT_NOTSET("resolution");
+  GAL_CONFIGFILES_END_OF_NOTSET_REPORT;
 }
 
 
@@ -511,15 +511,15 @@ sanitycheck(struct mkprofparams *p)
 
 
   /* If all the columns are within the catalog: */
-  CHECKCOLINCAT(p->xcol, "xcol");
-  CHECKCOLINCAT(p->ycol, "ycol");
-  CHECKCOLINCAT(p->fcol, "fcol");
-  CHECKCOLINCAT(p->rcol, "rcol");
-  CHECKCOLINCAT(p->ncol, "ncol");
-  CHECKCOLINCAT(p->pcol, "pcol");
-  CHECKCOLINCAT(p->qcol, "qcol");
-  CHECKCOLINCAT(p->mcol, "mcol");
-  CHECKCOLINCAT(p->tcol, "tcol");
+  GAL_CHECKSET_CHECK_COL_IN_CAT(p->xcol, "xcol");
+  GAL_CHECKSET_CHECK_COL_IN_CAT(p->ycol, "ycol");
+  GAL_CHECKSET_CHECK_COL_IN_CAT(p->fcol, "fcol");
+  GAL_CHECKSET_CHECK_COL_IN_CAT(p->rcol, "rcol");
+  GAL_CHECKSET_CHECK_COL_IN_CAT(p->ncol, "ncol");
+  GAL_CHECKSET_CHECK_COL_IN_CAT(p->pcol, "pcol");
+  GAL_CHECKSET_CHECK_COL_IN_CAT(p->qcol, "qcol");
+  GAL_CHECKSET_CHECK_COL_IN_CAT(p->mcol, "mcol");
+  GAL_CHECKSET_CHECK_COL_IN_CAT(p->tcol, "tcol");
 
 
   /* Check if all the profile codes are within the desired range: */
@@ -719,7 +719,7 @@ setparams(int argc, char *argv[], struct mkprofparams *p)
 {
   char *jobname;
   struct timeval t1;
-  char message[VERBMSGLENGTH_V];
+  char message[GAL_TIMING_VERB_MSG_LENGTH_V];
   struct commonparams *cp=&p->cp;
 
   /* Set the non-zero initial values, the structure was initialized to
@@ -737,14 +737,14 @@ setparams(int argc, char *argv[], struct mkprofparams *p)
     error(EXIT_FAILURE, errno, "Parsing arguments");
 
   /* Add the user default values and save them if asked. */
-  CHECKSETCONFIG;
+  GAL_CONFIGFILES_CHECK_SET_CONFIG;
 
   /* Check if all the required parameters are set. */
   checkifset(p);
 
   /* Print the values for each parameter. */
   if(cp->printparams)
-    REPORT_PARAMETERS_SET;
+    GAL_CONFIGFILES_REPORT_PARAMETERS_SET;
 
   /* Read catalog if given. */
   gal_txtarray_txt_to_array(p->up.catname, &p->cat, &p->cs0, &p->cs1);
@@ -765,7 +765,7 @@ setparams(int argc, char *argv[], struct mkprofparams *p)
      created by gal_txtarray_txt_to_array. */
   gettimeofday(&t1, NULL);
   sanitycheck(p);
-  gal_checkset_check_remove_file(TXTARRAYVVLOG, 0);
+  gal_checkset_check_remove_file(GAL_TXTARRAY_LOG, 0);
 
   /* Prepare the necessary arrays: */
   preparearrays(p);
diff --git a/src/noisechisel/args.h b/src/noisechisel/args.h
index c62dd8a..1b25e81 100644
--- a/src/noisechisel/args.h
+++ b/src/noisechisel/args.h
@@ -45,7 +45,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 /* Definition parameters for the argp: */
-const char *argp_program_version=SPACK_STRING"\n"COPYRIGHT
+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";
@@ -56,12 +56,12 @@ static char args_doc[] = "ASTRdata";
 
 const char doc[] =
   /* Before the list of options: */
-  TOPHELPINFO
+  GAL_STRINGS_TOP_HELP_INFO
   SPACK_NAME" Detects and segments signal that is deeply burried in noise. "
   "It employs a noise-based detection and segmentation method enabling it "
   "to be very resilient to the rich diversity of shapes in astronomical "
   "targets.\n"
-  MOREHELPINFO
+  GAL_STRINGS_MORE_HELP_INFO
   /* After the list of options: */
   "\v"
   PACKAGE_NAME" home page: "PACKAGE_URL;
diff --git a/src/noisechisel/binary.c b/src/noisechisel/binary.c
index bbce579..5289b7f 100644
--- a/src/noisechisel/binary.c
+++ b/src/noisechisel/binary.c
@@ -43,7 +43,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
  **************            Binary NAN           *****************
  ****************************************************************/
 /* When the float image has NaN pixels, set the respective byt value
-   to FITSBYTEBLANK. */
+   to GAL_FITSARRAY_BYTE_BLANK. */
 void
 setbytblank(float *img, unsigned char *byt, size_t size)
 {
@@ -51,7 +51,7 @@ setbytblank(float *img, unsigned char *byt, size_t size)
   do
     {
       if(isnan(*img++))
-        *byt=FITSBYTEBLANK;
+        *byt=GAL_FITSARRAY_BYTE_BLANK;
       ++byt;
     }
   while(img<end);
@@ -98,7 +98,7 @@ count_f_b_onregion(unsigned char *byt, size_t startind, 
size_t s0,
     {
       fb = ( b = byt + startind + is1*row++ ) + s1;
       do
-        *b ? (*b==FITSBYTEBLANK ? *anyblank=1: ++nf) : ++nb;
+        *b ? (*b==GAL_FITSARRAY_BYTE_BLANK ? *anyblank=1: ++nf) : ++nb;
       while(++b<fb);
     }
   while(row<s0);
@@ -533,7 +533,8 @@ fh_makeinv(unsigned char *byt, size_t s0, size_t s1,
       tp=tinv+start+row*idy;
       bf = ( bp = byt + row++ * s1 ) + s1;
       if(anyblank)
-        do *tp++ = *bp==FITSBYTEBLANK ? FITSBYTEBLANK : !*bp; while(++bp<bf);
+        do *tp++ = *bp==GAL_FITSARRAY_BYTE_BLANK
+             ? GAL_FITSARRAY_BYTE_BLANK : !*bp; while(++bp<bf);
       else
         do *tp++ = !*bp; while(++bp<bf);
     }
diff --git a/src/noisechisel/binary.h b/src/noisechisel/binary.h
index 1525917..10ac0d2 100644
--- a/src/noisechisel/binary.h
+++ b/src/noisechisel/binary.h
@@ -27,7 +27,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 
-/* For the FITSBYTEBLANK value: */
+/* For the GAL_FITSARRAY_BYTE_BLANK value: */
 #include "fitsarrayvv.h"
 
 
diff --git a/src/noisechisel/cite.h b/src/noisechisel/cite.h
index 38b6c28..8748c5b 100644
--- a/src/noisechisel/cite.h
+++ b/src/noisechisel/cite.h
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
           "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, GNUASTROBIBTEX,        \
+          SPACK_NAME, SPACK_NAME, SPACK_STRING, GAL_STRINGS_BIBTEX,    \
           SUBTRACTSKYBIBTEX);                                          \
     exit(EXIT_SUCCESS);                                                        
\
 }
diff --git a/src/noisechisel/clumps.c b/src/noisechisel/clumps.c
index 023ea95..23dad1e 100644
--- a/src/noisechisel/clumps.c
+++ b/src/noisechisel/clumps.c
@@ -77,7 +77,7 @@ oversegment(struct clumpsthreadparams *ctp)
   struct noisechiselparams *p=ctp->p;
 
   /* pix is not actually used its self, however, the pointer to it
-     will be extensively used (ind) for the macro FILL_NGB_8_REGION.
+     will be extensively used (ind) for the macro GAL_NEIGHBORS_FILL_8_REGION.
      This macro works on the pointer to the index, not the index its
      self. `pix` is filled with different index values, so the pointer
      to it doesn't change. */
@@ -182,7 +182,7 @@ oversegment(struct clumpsthreadparams *ctp)
                 /* Check the vicinity of this pixel that was just
                    popped to see if it can find any already labeled
                    neighbour or not. */
-                FILL_NGB_8_REGION;
+                GAL_NEIGHBORS_FILL_8_REGION;
 
                 /* If the pixel is on the side of the region, set it
                    as a river, no more need to look around it. */
@@ -413,7 +413,7 @@ growclumps(struct clumpsthreadparams *ctp, int withrivers)
          n1=0;
 
          /* Check the 4 connected neighbors of the pixel: */
-          FILL_NGB_4_ALLIMG;
+          GAL_NEIGHBORS_FILL_4_ALLIMG;
          nf=(n=ngb)+numngb;
          do
             if( olab[*n]>0 )                /* This neighbor is labeled. */
@@ -545,8 +545,8 @@ getclumpinfo(struct clumpsthreadparams *ctp, double 
**outclumpinfo)
                the neighbors within a region. Otherwise (when working
                on the detections) we want the neighbors on the full
                image.*/
-            if(p->b0f1) {FILL_NGB_8_ALLIMG}
-            else        {FILL_NGB_8_REGION}
+            if(p->b0f1) {GAL_NEIGHBORS_FILL_8_ALLIMG}
+            else        {GAL_NEIGHBORS_FILL_8_REGION}
 
 
             /* We are on a river pixel. So its value has to be added
@@ -790,7 +790,7 @@ clumpsntableonmesh(void *inparams)
   ctp.inds=&mponeforall[mtp->id*mp->maxs0*mp->maxs1];
 
   /* Go over all the meshs that are assigned to this thread. */
-  for(i=0;indexs[i]!=NONTHRDINDEX;++i)
+  for(i=0;indexs[i]!=GAL_THREADS_NON_THRD_INDEX;++i)
     {
       /* Set index of this mesh: */
       ind=ctp.thislabel=indexs[i];
@@ -979,7 +979,7 @@ removefalseclumps(struct clumpsthreadparams *ctp, float 
*sntable)
           /* Check to see if the brightest pixel in this clump is
              touching a river or not. */
           ind=&ctp->topinds[i];
-          FILL_NGB_8_ALLIMG;
+          GAL_NEIGHBORS_FILL_8_ALLIMG;
           nf=(n=ngb)+numngb;
           do if(clab[*n++]==SEGMENTRIVER) break; while(n<nf);
 
diff --git a/src/noisechisel/detection.c b/src/noisechisel/detection.c
index 58957c7..1f2ac2b 100644
--- a/src/noisechisel/detection.c
+++ b/src/noisechisel/detection.c
@@ -66,7 +66,7 @@ void
 initialdetection(struct noisechiselparams *p)
 {
   int verb=p->cp.verb;
-  char report[VERBMSGLENGTHS2_V];
+  char report[GAL_TIMING_VERB_MSG_LENGTHS_2_V];
   size_t i, s0=p->smp.s0, s1=p->smp.s1;
   char *detectionname=p->detectionname;
 
@@ -325,7 +325,7 @@ applydetsn(struct noisechiselparams *p, float *sntable, 
size_t numpseudo)
   lf= (lab=clab) + p->smp.s0*p->smp.s1;
   do
     {
-      if(*lab!=FITSLONGBLANK)
+      if(*lab!=GAL_FITSARRAY_LONG_BLANK)
         *b = newlabs[*lab] > 0;
       ++b;
     }
@@ -380,7 +380,8 @@ bytpartfromlarge(struct noisechiselparams *p, unsigned char 
*out,
       bf = ( b = p->byt + start + r++ * is1 ) + s1;
       do
         {
-          *out++ = *b==b0f1 ? *d : (*b==FITSBYTEBLANK ? FITSBYTEBLANK : 0);
+          *out++ = *b==b0f1 ? *d : (*b==GAL_FITSARRAY_BYTE_BLANK
+                                    ? GAL_FITSARRAY_BYTE_BLANK : 0);
           ++d;
         }
       while(++b<bf);
@@ -433,7 +434,7 @@ detectpseudos(void *inparams)
 
 
   /* Do the job for each mesh: */
-  for(i=0;indexs[i]!=NONTHRDINDEX;++i)
+  for(i=0;indexs[i]!=GAL_THREADS_NON_THRD_INDEX;++i)
     {
       /* Set the necesary parameters: */
       ind=indexs[i];
@@ -456,7 +457,8 @@ detectpseudos(void *inparams)
       if(p->anyblank)
         {
           bf=(b=thisbyt)+s0*s1;
-          do if(*b++==FITSBYTEBLANK) { anyblank=1; break; } while(b<bf);
+          do if(*b++==GAL_FITSARRAY_BYTE_BLANK) { anyblank=1; break; }
+          while(b<bf);
         }
 
 
@@ -646,7 +648,7 @@ dbytolaboverlap(struct noisechiselparams *p)
   if(p->dilate)
     do
       {
-        if(*lab!=FITSLONGBLANK)
+        if(*lab!=GAL_FITSARRAY_LONG_BLANK)
           *byt=tokeep[*lab]>0;
         ++byt;
       }
@@ -654,7 +656,7 @@ dbytolaboverlap(struct noisechiselparams *p)
   else
     do
       {
-        if(*lab!=FITSLONGBLANK)
+        if(*lab!=GAL_FITSARRAY_LONG_BLANK)
           *byt = ( *lab = tokeep[*lab] ) > 0;
         ++byt;
       }
@@ -696,7 +698,7 @@ onlytruedetections(struct noisechiselparams *p)
   struct meshparams *lmp=&p->lmp;
 
   int verb=p->cp.verb;
-  char report[VERBMSGLENGTHS2_V];
+  char report[GAL_TIMING_VERB_MSG_LENGTHS_2_V];
   char *detectionname=p->detectionname;
   size_t s0=lmp->s0, s1=lmp->s1, numobjects=p->numobjects;
 
diff --git a/src/noisechisel/label.c b/src/noisechisel/label.c
index 8deeb90..b3bd6f5 100644
--- a/src/noisechisel/label.c
+++ b/src/noisechisel/label.c
@@ -77,7 +77,8 @@ BF_concmp(unsigned char *byt, long *lab, size_t s0, size_t s1,
      array, then give them the blank labeled array. Note that since
      their value will not be 0, they will also not be labeled. */
   if(anyblank)
-    do *l++ = *b==FITSBYTEBLANK ? FITSLONGBLANK : 0; while(++b<bf);
+    do *l++ = *b==GAL_FITSARRAY_BYTE_BLANK ? GAL_FITSARRAY_LONG_BLANK
+         : 0; while(++b<bf);
   else
     memset(lab, 0, size*sizeof *lab);
 
@@ -308,13 +309,13 @@ removesmallarea_relabel(long *in, unsigned char *byt, 
size_t size,
   if(byt)
     {
       for(i=0;i<size;++i)
-        if(in[i]!=FITSLONGBLANK)
+        if(in[i]!=GAL_FITSARRAY_LONG_BLANK)
           byt[i] = (in[i]=newlabs[in[i]]) > 0;
     }
   else
     {
       for(i=0;i<size;++i)
-        if(in[i]!=FITSLONGBLANK)
+        if(in[i]!=GAL_FITSARRAY_LONG_BLANK)
           in[i]=newlabs[in[i]];
     }
 
diff --git a/src/noisechisel/label.h b/src/noisechisel/label.h
index 76043a1..df3fcc8 100644
--- a/src/noisechisel/label.h
+++ b/src/noisechisel/label.h
@@ -27,7 +27,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 
-/* For the FITSLONGBLANK and FITSBYTEBLANK macros: */
+/* For the GAL_FITSARRAY_LONG_BLANK and GAL_FITSARRAY_BYTE_BLANK macros: */
 #include "fitsarrayvv.h"
 
 
@@ -39,10 +39,10 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
    check. The compiler has no idea of our convention to label things
    with positive indices, so we can't rely on the compiler to optimize
    this. */
-#if FITSLONGBLANK<0
+#if GAL_FITSARRAY_LONG_BLANK<0
 #define ISINDEXABLELABEL (*lab>0)
 #else
-#define ISINDEXABLELABEL (*lab && *lab!=FITSLONGBLANK)
+#define ISINDEXABLELABEL (*lab && *lab!=GAL_FITSARRAY_LONG_BLANK)
 #endif
 
 
diff --git a/src/noisechisel/noisechisel.c b/src/noisechisel/noisechisel.c
index 4e35db8..d821f19 100644
--- a/src/noisechisel/noisechisel.c
+++ b/src/noisechisel/noisechisel.c
@@ -155,7 +155,7 @@ noisechisel(struct noisechiselparams *p)
   struct timeval t1;
   int verb=p->cp.verb;
   size_t i, s0=smp->s0, s1=smp->s1;
-  char report[VERBMSGLENGTH_V], *oreport;
+  char report[GAL_TIMING_VERB_MSG_LENGTH_V], *oreport;
 
 
   /* Convolve the image: */
diff --git a/src/noisechisel/segmentation.c b/src/noisechisel/segmentation.c
index a978f55..1aaedb7 100644
--- a/src/noisechisel/segmentation.c
+++ b/src/noisechisel/segmentation.c
@@ -190,7 +190,7 @@ adjacencymatrixs(struct clumpsthreadparams *ctp,
        memset(wngb, 0, sizeof(wngb));
 
        /* Find which grown clumps this river pixel touches.      */
-       FILL_NGB_8_ALLIMG;
+       GAL_NEIGHBORS_FILL_8_ALLIMG;
        nf=(n=ngb)+numngb;
        do
          if( olab[*n]>0 )
@@ -481,7 +481,7 @@ segmentonthread(void *inparam)
 
   /* Go over all the initial detections that were assigned to this
      thread. */
-  for(i=0;ctp->indexs[i]!=NONTHRDINDEX;++i)
+  for(i=0;ctp->indexs[i]!=GAL_THREADS_NON_THRD_INDEX;++i)
     if(ctp->indexs[i])   /* sp->indexs[i]==0 for the background. */
       {
         /* Keep the initial label of this detection. The initial label
@@ -675,7 +675,7 @@ segmentdetections(struct noisechiselparams *p, size_t 
numobjsinit,
 
       /* Spin off the threads: */
       for(i=0;i<numthreads;++i)
-       if(indexs[i*thrdcols]!=NONTHRDINDEX)
+       if(indexs[i*thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
          {
             ctp[i].p=p;
             ctp[i].id=i;
@@ -734,7 +734,7 @@ clabwithnoseg(long *olab, long *clab, size_t size, int 
anyblank)
 
   if(anyblank)
     do
-      *clab++ = ( *olab==FITSLONGBLANK ? FITSLONGBLANK
+      *clab++ = ( *olab==GAL_FITSARRAY_LONG_BLANK ? GAL_FITSARRAY_LONG_BLANK
                   : ( *olab>0 ? SEGMENTINIT : 0 ) );
     while(++olab<end);
   else
@@ -792,7 +792,8 @@ segmentation(struct noisechiselparams *p)
   if(p->anyblank)
     {
       b=p->byt;lf=(l=p->clab)+s0*s1;
-      do *l = *b++==FITSBYTEBLANK ? FITSLONGBLANK : 0; while(++l<lf);
+      do *l = *b++==GAL_FITSARRAY_BYTE_BLANK ? GAL_FITSARRAY_LONG_BLANK
+           : 0; while(++l<lf);
     }
   else
     memset(p->clab, 0, s0*s1*sizeof *p->clab);
@@ -816,7 +817,8 @@ segmentation(struct noisechiselparams *p)
   if(p->anyblank)
     {
       lf=(l=p->clab)+s0*s1;
-      do *l = *l==FITSLONGBLANK ? FITSLONGBLANK : 0; while(++l<lf);
+      do *l = *l==GAL_FITSARRAY_LONG_BLANK ? GAL_FITSARRAY_LONG_BLANK
+           : 0; while(++l<lf);
     }
   else memset(p->clab, 0, s0*s1*sizeof *p->clab);
 
@@ -841,7 +843,8 @@ segmentation(struct noisechiselparams *p)
           if(p->anyblank)
             {
               lf=(l=p->clab)+s0*s1;
-              do *l = *l==FITSLONGBLANK ? FITSLONGBLANK : 0; while(++l<lf);
+              do *l = *l==GAL_FITSARRAY_LONG_BLANK ? GAL_FITSARRAY_LONG_BLANK
+                   : 0; while(++l<lf);
             }
           else memset(p->clab, 0, s0*s1*sizeof *p->clab);
 
diff --git a/src/noisechisel/sky.c b/src/noisechisel/sky.c
index 503690d..138ee56 100644
--- a/src/noisechisel/sky.c
+++ b/src/noisechisel/sky.c
@@ -52,7 +52,7 @@ avestdonthread(void *inparam)
   size_t i, num, row, *indexs=&mp->indexs[mtp->id*mp->thrdcols];
 
   /* Start this thread's work: */
-  for(i=0;indexs[i]!=NONTHRDINDEX;++i)
+  for(i=0;indexs[i]!=GAL_THREADS_NON_THRD_INDEX;++i)
     {
       /* Prepare the values: */
       num=row=0;
diff --git a/src/noisechisel/thresh.c b/src/noisechisel/thresh.c
index 88e2b9b..3bfb2ec 100644
--- a/src/noisechisel/thresh.c
+++ b/src/noisechisel/thresh.c
@@ -67,7 +67,7 @@ qthreshonmesh(void *inparam)
   float mirrordist=mp->mirrordist, minmodeq=mp->minmodeq;
 
   /* Start this thread's work: */
-  for(i=0;indexs[i]!=NONTHRDINDEX;++i)
+  for(i=0;indexs[i]!=GAL_THREADS_NON_THRD_INDEX;++i)
     {
       /* Prepare the values: */
       num=row=0;
@@ -100,7 +100,7 @@ qthreshonmesh(void *inparam)
           qsort(oneforall, num, sizeof *oneforall, gal_qsort_float_increasing);
           gal_mode_index_in_sorted(oneforall, num, mirrordist, &modeindex,
                                    &modesym);
-          if( modesym>MODESYMGOOD && (float)modeindex/(float)num>minmodeq)
+          if( modesym>GAL_MODE_SYM_GOOD && 
(float)modeindex/(float)num>minmodeq)
             mp->garray1[ind]=
               oneforall[gal_statistics_index_from_quantile(num, qthresh)];
         }
@@ -274,7 +274,7 @@ applydetectionthresholdskysub(struct noisechiselparams *p)
                  image, they will be checked. */
               *b = ( (*f++=*in-sky) > dthresh*std
                      ? 1
-                     : isnan(*in) ? FITSBYTEBLANK : 0 );
+                     : isnan(*in) ? GAL_FITSARRAY_BYTE_BLANK : 0 );
               ++in;
             }
           while(++b<bf);
diff --git a/src/noisechisel/ui.c b/src/noisechisel/ui.c
index 3c6ae46..c1432eb 100644
--- a/src/noisechisel/ui.c
+++ b/src/noisechisel/ui.c
@@ -95,7 +95,7 @@ readconfig(char *filename, struct noisechiselparams *p)
   while(getline(&line, &len, fp) != -1)
     {
       /* Prepare the "name" and "value" strings, also set lineno. */
-      STARTREADINGLINE;
+      GAL_CONFIGFILES_START_READING_LINE;
 
 
       /* Inputs: */
@@ -421,7 +421,7 @@ readconfig(char *filename, struct noisechiselparams *p)
 
       /* Operating modes: */
       /* Read options common to all programs */
-      READ_COMMONOPTIONS_FROM_CONF
+      GAL_CONFIGFILES_READ_COMMONOPTIONS_FROM_CONF
 
 
       else
@@ -575,7 +575,7 @@ printvalues(FILE *fp, struct noisechiselparams *p)
      options, then the (possible options particular to this
      program). */
   fprintf(fp, "\n# Operating mode:\n");
-  PRINT_COMMONOPTIONS;
+  GAL_CONFIGFILES_PRINT_COMMONOPTIONS;
 }
 
 
@@ -593,89 +593,89 @@ checkifset(struct noisechiselparams *p)
 
   int intro=0;
   if(cp->hduset==0)
-    REPORT_NOTSET("hdu");
+    GAL_CONFIGFILES_REPORT_NOTSET("hdu");
   if(up->khduset==0)
-    REPORT_NOTSET("khdu");
+    GAL_CONFIGFILES_REPORT_NOTSET("khdu");
   if(up->skysubtractedset==0)
-    REPORT_NOTSET("skysubtracted");
+    GAL_CONFIGFILES_REPORT_NOTSET("skysubtracted");
   if(up->minbfracset==0)
-    REPORT_NOTSET("minbfrac");
+    GAL_CONFIGFILES_REPORT_NOTSET("minbfrac");
   if(up->minnumfalseset==0)
-    REPORT_NOTSET("minnumfalse");
+    GAL_CONFIGFILES_REPORT_NOTSET("minnumfalse");
 
   /* Output */
   if(up->grownclumpsset==0)
-    REPORT_NOTSET("grownclumps");
+    GAL_CONFIGFILES_REPORT_NOTSET("grownclumps");
 
   /* Mesh grid: */
   if(up->smeshsizeset==0)
-    REPORT_NOTSET("smeshsize");
+    GAL_CONFIGFILES_REPORT_NOTSET("smeshsize");
   if(up->lmeshsizeset==0)
-    REPORT_NOTSET("lmeshsize");
+    GAL_CONFIGFILES_REPORT_NOTSET("lmeshsize");
   if(up->nch1set==0)
-    REPORT_NOTSET("nch1");
+    GAL_CONFIGFILES_REPORT_NOTSET("nch1");
   if(up->nch2set==0)
-    REPORT_NOTSET("nch2");
+    GAL_CONFIGFILES_REPORT_NOTSET("nch2");
   if(up->lastmeshfracset==0)
-    REPORT_NOTSET("lastmeshfrac");
+    GAL_CONFIGFILES_REPORT_NOTSET("lastmeshfrac");
   if(up->mirrordistset==0)
-    REPORT_NOTSET("mirrordist");
+    GAL_CONFIGFILES_REPORT_NOTSET("mirrordist");
   if(up->minmodeqset==0)
-    REPORT_NOTSET("minmodeq");
+    GAL_CONFIGFILES_REPORT_NOTSET("minmodeq");
   if(up->numnearestset==0)
-    REPORT_NOTSET("numnearest");
+    GAL_CONFIGFILES_REPORT_NOTSET("numnearest");
   if(up->smoothwidthset==0)
-    REPORT_NOTSET("smoothwidth");
+    GAL_CONFIGFILES_REPORT_NOTSET("smoothwidth");
   if(up->fullconvolutionset==0)
-    REPORT_NOTSET("fullconvolution");
+    GAL_CONFIGFILES_REPORT_NOTSET("fullconvolution");
   if(up->fullinterpolationset==0)
-    REPORT_NOTSET("fullinterpolation");
+    GAL_CONFIGFILES_REPORT_NOTSET("fullinterpolation");
   if(up->fullsmoothset==0)
-    REPORT_NOTSET("fullsmooth");
+    GAL_CONFIGFILES_REPORT_NOTSET("fullsmooth");
 
   /* Detection: */
   if(up->qthreshset==0)
-    REPORT_NOTSET("qthresh");
+    GAL_CONFIGFILES_REPORT_NOTSET("qthresh");
   if(up->erodeset==0)
-    REPORT_NOTSET("erode");
+    GAL_CONFIGFILES_REPORT_NOTSET("erode");
   if(up->erodengbset==0)
-    REPORT_NOTSET("erodengb");
+    GAL_CONFIGFILES_REPORT_NOTSET("erodengb");
   if(up->openingset==0)
-    REPORT_NOTSET("opening");
+    GAL_CONFIGFILES_REPORT_NOTSET("opening");
   if(up->openingngbset==0)
-    REPORT_NOTSET("openingngb");
+    GAL_CONFIGFILES_REPORT_NOTSET("openingngb");
   if(up->sigclipmultipset==0)
-    REPORT_NOTSET("sigclipmultip");
+    GAL_CONFIGFILES_REPORT_NOTSET("sigclipmultip");
   if(up->sigcliptoleranceset==0)
-    REPORT_NOTSET("sigcliptolerance");
+    GAL_CONFIGFILES_REPORT_NOTSET("sigcliptolerance");
   if(up->dthreshset==0)
-    REPORT_NOTSET("dthresh");
+    GAL_CONFIGFILES_REPORT_NOTSET("dthresh");
   if(up->detsnminareaset==0)
-    REPORT_NOTSET("detsnminarea");
+    GAL_CONFIGFILES_REPORT_NOTSET("detsnminarea");
   if(up->detsnhistnbinsset==0)
-    REPORT_NOTSET("detsnhistnbins");
+    GAL_CONFIGFILES_REPORT_NOTSET("detsnhistnbins");
   if(up->detquantset==0)
-    REPORT_NOTSET("detquant");
+    GAL_CONFIGFILES_REPORT_NOTSET("detquant");
   if(up->dilateset==0)
-    REPORT_NOTSET("dilate");
+    GAL_CONFIGFILES_REPORT_NOTSET("dilate");
 
   /* Segmentation: */
   if(up->segsnminareaset==0)
-    REPORT_NOTSET("segsnminarea");
+    GAL_CONFIGFILES_REPORT_NOTSET("segsnminarea");
   if(up->keepmaxnearriverset==0)
-    REPORT_NOTSET("keepmaxnearriver");
+    GAL_CONFIGFILES_REPORT_NOTSET("keepmaxnearriver");
   if(up->segquantset==0)
-    REPORT_NOTSET("segquant");
+    GAL_CONFIGFILES_REPORT_NOTSET("segquant");
   if(up->segsnhistnbinsset==0)
-    REPORT_NOTSET("segsnhistnbins");
+    GAL_CONFIGFILES_REPORT_NOTSET("segsnhistnbins");
   if(up->gthreshset==0)
-    REPORT_NOTSET("gthresh");
+    GAL_CONFIGFILES_REPORT_NOTSET("gthresh");
   if(up->minriverlengthset==0)
-    REPORT_NOTSET("minriverlength");
+    GAL_CONFIGFILES_REPORT_NOTSET("minriverlength");
   if(up->objbordersnset==0)
-    REPORT_NOTSET("objbordersn");
+    GAL_CONFIGFILES_REPORT_NOTSET("objbordersn");
 
-  END_OF_NOTSET_REPORT;
+  GAL_CONFIGFILES_END_OF_NOTSET_REPORT;
 }
 
 
@@ -792,10 +792,10 @@ sanitycheck(struct noisechiselparams *p)
 
 
   /* Other checks: */
-  if(smp->numnearest<MINACCEPTABLENEAREST)
+  if(smp->numnearest<GAL_MESH_MIN_ACCEPTABLE_NEAREST)
     error(EXIT_FAILURE, 0, "The smallest possible number for `--numnearest' "
-          "(`-n') is %d. You have asked for: %lu.", MINACCEPTABLENEAREST,
-          smp->numnearest);
+          "(`-n') is %d. You have asked for: %lu.",
+          GAL_MESH_MIN_ACCEPTABLE_NEAREST, smp->numnearest);
 }
 
 
@@ -1052,14 +1052,14 @@ setparams(int argc, char *argv[], struct 
noisechiselparams *p)
     error(EXIT_FAILURE, errno, "Parsing arguments");
 
   /* Add the user default values and save them if asked. */
-  CHECKSETCONFIG;
+  GAL_CONFIGFILES_CHECK_SET_CONFIG;
 
   /* Check if all the required parameters are set. */
   checkifset(p);
 
   /* Print the values for each parameter. */
   if(cp->printparams)
-    REPORT_PARAMETERS_SET;
+    GAL_CONFIGFILES_REPORT_PARAMETERS_SET;
 
   /* Do a sanity check. */
   sanitycheck(p);
diff --git a/src/subtractsky/args.h b/src/subtractsky/args.h
index 55781bd..95ca94b 100644
--- a/src/subtractsky/args.h
+++ b/src/subtractsky/args.h
@@ -45,7 +45,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 /* Definition parameters for the argp: */
-const char *argp_program_version=SPACK_STRING"\n"COPYRIGHT
+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";
@@ -56,10 +56,10 @@ static char args_doc[] = "ASTRdata";
 
 const char doc[] =
   /* Before the list of options: */
-  TOPHELPINFO
+  GAL_STRINGS_TOP_HELP_INFO
   SPACK_NAME" Finds the sky value over a grid on the input and subtracts "
   "it from the image to give a clear and uniform output. \n"
-  MOREHELPINFO
+  GAL_STRINGS_MORE_HELP_INFO
   /* After the list of options: */
   "\v"
   PACKAGE_NAME" home page: "PACKAGE_URL;
diff --git a/src/subtractsky/cite.h b/src/subtractsky/cite.h
index 54ec484..ec98919 100644
--- a/src/subtractsky/cite.h
+++ b/src/subtractsky/cite.h
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
           "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, GNUASTROBIBTEX,        \
+          SPACK_NAME, SPACK_NAME, SPACK_STRING, GAL_STRINGS_BIBTEX,    \
           SUBTRACTSKYBIBTEX);                                          \
     exit(EXIT_SUCCESS);                                                        
\
 }
diff --git a/src/subtractsky/subtractsky.c b/src/subtractsky/subtractsky.c
index 6daa1b0..6645198 100644
--- a/src/subtractsky/subtractsky.c
+++ b/src/subtractsky/subtractsky.c
@@ -71,7 +71,7 @@ avestdonthread(void *inparam)
   else cofa=NULL;
 
   /* Start this thread's work: */
-  for(i=0;indexs[i]!=NONTHRDINDEX;++i)
+  for(i=0;indexs[i]!=GAL_THREADS_NON_THRD_INDEX;++i)
     {
       /* Prepare the values: */
       num=row=0;
@@ -108,7 +108,7 @@ avestdonthread(void *inparam)
       /* Do the desired operation on the mesh: */
       qsort(sorted, num, sizeof *oneforall, gal_qsort_float_increasing);
       gal_mode_index_in_sorted(sorted, num, mirrordist, &modeindex, &modesym);
-      if( modesym>MODESYMGOOD && (float)modeindex/(float)num>minmodeq )
+      if( modesym>GAL_MODE_SYM_GOOD && (float)modeindex/(float)num>minmodeq )
         {
           /* If cofa was defined, then oneforall was not sorted. */
           if(cofa)
diff --git a/src/subtractsky/ui.c b/src/subtractsky/ui.c
index da352c4..484c9fe 100644
--- a/src/subtractsky/ui.c
+++ b/src/subtractsky/ui.c
@@ -95,7 +95,7 @@ readconfig(char *filename, struct subtractskyparams *p)
   while(getline(&line, &len, fp) != -1)
     {
       /* Prepare the "name" and "value" strings, also set lineno. */
-      STARTREADINGLINE;
+      GAL_CONFIGFILES_START_READING_LINE;
 
 
       /* Inputs: */
@@ -264,7 +264,7 @@ readconfig(char *filename, struct subtractskyparams *p)
 
       /* Operating modes: */
       /* Read options common to all programs */
-      READ_COMMONOPTIONS_FROM_CONF
+      GAL_CONFIGFILES_READ_COMMONOPTIONS_FROM_CONF
 
 
       else
@@ -370,7 +370,7 @@ printvalues(FILE *fp, struct subtractskyparams *p)
      options, then the (possible options particular to this
      program). */
   fprintf(fp, "\n# Operating mode:\n");
-  PRINT_COMMONOPTIONS;
+  GAL_CONFIGFILES_PRINT_COMMONOPTIONS;
 }
 
 
@@ -388,41 +388,41 @@ checkifset(struct subtractskyparams *p)
 
   int intro=0;
   if(cp->hduset==0)
-    REPORT_NOTSET("hdu");
+    GAL_CONFIGFILES_REPORT_NOTSET("hdu");
   if(up->khduset==0)
-    REPORT_NOTSET("khdu");
+    GAL_CONFIGFILES_REPORT_NOTSET("khdu");
 
   /* Mesh grid: */
   if(up->meshsizeset==0)
-    REPORT_NOTSET("meshsize");
+    GAL_CONFIGFILES_REPORT_NOTSET("meshsize");
   if(up->nch1set==0)
-    REPORT_NOTSET("nch1");
+    GAL_CONFIGFILES_REPORT_NOTSET("nch1");
   if(up->nch2set==0)
-    REPORT_NOTSET("nch2");
+    GAL_CONFIGFILES_REPORT_NOTSET("nch2");
   if(up->lastmeshfracset==0)
-    REPORT_NOTSET("lastmeshfrac");
+    GAL_CONFIGFILES_REPORT_NOTSET("lastmeshfrac");
   if(up->mirrordistset==0)
-    REPORT_NOTSET("mirrordist");
+    GAL_CONFIGFILES_REPORT_NOTSET("mirrordist");
   if(up->minmodeqset==0)
-    REPORT_NOTSET("minmodeq");
+    GAL_CONFIGFILES_REPORT_NOTSET("minmodeq");
   if(up->numnearestset==0)
-    REPORT_NOTSET("numnearest");
+    GAL_CONFIGFILES_REPORT_NOTSET("numnearest");
   if(up->smoothwidthset==0)
-    REPORT_NOTSET("smoothwidth");
+    GAL_CONFIGFILES_REPORT_NOTSET("smoothwidth");
   if(up->fullconvolutionset==0)
-    REPORT_NOTSET("fullconvolution");
+    GAL_CONFIGFILES_REPORT_NOTSET("fullconvolution");
   if(up->fullinterpolationset==0)
-    REPORT_NOTSET("fullinterpolation");
+    GAL_CONFIGFILES_REPORT_NOTSET("fullinterpolation");
   if(up->fullsmoothset==0)
-    REPORT_NOTSET("fullsmooth");
+    GAL_CONFIGFILES_REPORT_NOTSET("fullsmooth");
 
   /* Statistics: */
   if(up->sigclipmultipset==0)
-    REPORT_NOTSET("sigclipmultip");
+    GAL_CONFIGFILES_REPORT_NOTSET("sigclipmultip");
   if(up->sigcliptoleranceset==0)
-    REPORT_NOTSET("sigcliptolerance");
+    GAL_CONFIGFILES_REPORT_NOTSET("sigcliptolerance");
 
-  END_OF_NOTSET_REPORT;
+  GAL_CONFIGFILES_END_OF_NOTSET_REPORT;
 }
 
 
@@ -490,10 +490,10 @@ sanitycheck(struct subtractskyparams *p)
 
 
   /* Other checks: */
-  if(p->mp.numnearest<MINACCEPTABLENEAREST)
+  if(p->mp.numnearest<GAL_MESH_MIN_ACCEPTABLE_NEAREST)
     error(EXIT_FAILURE, 0, "The smallest possible number for `--numnearest' "
-          "(`-n') is %d. You have asked for: %lu.", MINACCEPTABLENEAREST,
-          p->mp.numnearest);
+          "(`-n') is %d. You have asked for: %lu.",
+          GAL_MESH_MIN_ACCEPTABLE_NEAREST, p->mp.numnearest);
 
   /* Set the constants in the meshparams structure. */
   p->mp.params=p;
@@ -585,14 +585,14 @@ setparams(int argc, char *argv[], struct 
subtractskyparams *p)
     error(EXIT_FAILURE, errno, "Parsing arguments");
 
   /* Add the user default values and save them if asked. */
-  CHECKSETCONFIG;
+  GAL_CONFIGFILES_CHECK_SET_CONFIG;
 
   /* Check if all the required parameters are set. */
   checkifset(p);
 
   /* Print the values for each parameter. */
   if(cp->printparams)
-    REPORT_PARAMETERS_SET;
+    GAL_CONFIGFILES_REPORT_PARAMETERS_SET;
 
   /* Do a sanity check. */
   sanitycheck(p);



reply via email to

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