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 4d75edad74d15f1722be24cc1ccc4d0318814882
Author: Mosè Giordano <address@hidden>
Date:   Sat Nov 7 18:16:43 2015 +0100

    Rename exported variables to follow new naming conventions
    
    Addresses task#13765.
---
 include/commonargs.h           |    7 +-
 include/commonparams.h         |    2 +-
 include/fitsarrayvv.h          |   31 +++----
 include/forqsort.h             |    2 +-
 include/linkedlist.h           |  115 ++++++++++++++------------
 include/mesh.h                 |   34 ++++----
 include/mode.h                 |    2 +-
 include/spatialconvolve.h      |    4 +-
 lib/fitsarrayvv.c              |   39 +++++----
 lib/forqsort.c                 |    6 +-
 lib/linkedlist.c               |  177 ++++++++++++++++++++++------------------
 lib/mesh.c                     |   64 +++++++--------
 lib/mode.c                     |    6 +-
 lib/spatialconvolve.c          |    7 +-
 src/convertt/main.h            |    4 +-
 src/convertt/ui.c              |   16 ++--
 src/convolve/convolve.c        |    2 +-
 src/convolve/main.h            |    4 +-
 src/convolve/ui.c              |   12 +--
 src/header/header.c            |    7 +-
 src/header/main.h              |   22 ++---
 src/header/ui.c                |   17 ++--
 src/imgcrop/args.h             |    4 +-
 src/imgcrop/crop.c             |   12 +--
 src/imgcrop/imgcrop.c          |    2 +-
 src/imgcrop/main.h             |    4 +-
 src/imgcrop/ui.c               |   12 +--
 src/imgstat/main.h             |    2 +-
 src/imgstat/ui.c               |    8 +-
 src/imgwarp/imgwarp.c          |    2 +-
 src/imgwarp/main.h             |    2 +-
 src/imgwarp/ui.c               |    8 +-
 src/mkcatalog/main.h           |    4 +-
 src/mkcatalog/ui.c             |   10 +--
 src/mknoise/main.h             |    2 +-
 src/mknoise/mknoise.c          |    2 +-
 src/mknoise/ui.c               |    8 +-
 src/mkprof/main.h              |    2 +-
 src/mkprof/oneprofile.c        |    4 +-
 src/mkprof/ui.c                |    6 +-
 src/noisechisel/clumps.c       |   14 ++--
 src/noisechisel/detection.c    |   10 +--
 src/noisechisel/label.c        |    4 +-
 src/noisechisel/main.h         |    8 +-
 src/noisechisel/noisechisel.c  |    4 +-
 src/noisechisel/segmentation.c |    2 +-
 src/noisechisel/sky.c          |   10 +--
 src/noisechisel/thresh.c       |   16 ++--
 src/noisechisel/ui.c           |   14 ++--
 src/subtractsky/main.h         |    4 +-
 src/subtractsky/subtractsky.c  |    6 +-
 src/subtractsky/ui.c           |   14 ++--
 52 files changed, 410 insertions(+), 370 deletions(-)

diff --git a/include/commonargs.h b/include/commonargs.h
index f8c406d..ee4b9a2 100644
--- a/include/commonargs.h
+++ b/include/commonargs.h
@@ -57,7 +57,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
    You can use this above list to set short options for the different
    utilities.
  */
-static struct argp_option coptions[] =
+static struct argp_option gal_commonargs_options[] =
   {
     /* -1 is the code for operating modes: */
     {
@@ -194,7 +194,7 @@ static error_t
 gal_checkset_commonargs_cparse_opt(int key, char *arg, struct argp_state 
*state)
 {
   /* Save the arguments structure: */
-  struct commonparams *cp=state->input;
+  struct gal_commonparams *cp=state->input;
 
   /* In case the user incorrectly uses the equal sign (for example
      with a short format or with space in the long format, then `arg`
@@ -291,7 +291,8 @@ gal_checkset_commonargs_cparse_opt(int key, char *arg, 
struct argp_state *state)
 
 
 
-static struct argp commonargp = {coptions, gal_checkset_commonargs_cparse_opt,
+static struct argp commonargp = {gal_commonargs_options,
+                                 gal_checkset_commonargs_cparse_opt,
                                  NULL, NULL, NULL, NULL, NULL};
 
 #endif
diff --git a/include/commonparams.h b/include/commonparams.h
index 867c126..4dc41f7 100644
--- a/include/commonparams.h
+++ b/include/commonparams.h
@@ -28,7 +28,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
    could be part of commonargs.h, but since main.h in all those
    programs will need this structure, there will be problems about the
    unused `commonargp` structure.*/
-struct commonparams
+struct gal_commonparams
 {
   char        *spack;  /* Subpackage name.                              */
 
diff --git a/include/fitsarrayvv.h b/include/fitsarrayvv.h
index 59c511e..060dd4c 100644
--- a/include/fitsarrayvv.h
+++ b/include/fitsarrayvv.h
@@ -84,7 +84,7 @@ gal_fitsarray_num_hdus(char *filename, int *numhdu);
  ******************         Header          ******************
  *************************************************************/
 /* To create a linked list of headers. */
-struct fitsheaderll
+struct gal_fitsarray_header_ll
 {
   int                 kfree;   /* ==1, keyname will be freed.          */
   int                 vfree;   /* ==1, value will be freed.            */
@@ -94,14 +94,14 @@ struct fitsheaderll
   void               *value;   /* Pointer to the value of the keyword. */
   char             *comment;   /* Comment for the keyword.             */
   char                *unit;   /* Units of the keyword.                */
-  struct fitsheaderll *next;   /* Pointer to the next element.         */
+  struct gal_fitsarray_header_ll *next;   /* Pointer to the next element.      
   */
 };
 
 
 
 
 
-struct readheaderkeys
+struct gal_fitsarray_read_header_keys
 {
   char   *keyname;
   int    datatype;
@@ -120,33 +120,36 @@ struct readheaderkeys
 
 void
 gal_fitsarray_read_keywords(char *filename, char *hdu,
-                            struct readheaderkeys *out, size_t num);
+                            struct gal_fitsarray_read_header_keys *out,
+                            size_t num);
 
 void
-gal_fitsarray_add_to_fits_header_ll(struct fitsheaderll **list, int datatype,
-                                    char *keyname, int kfree, void *value,
-                                    int vfree, char *comment, int cfree,
-                                    char *unit);
+gal_fitsarray_add_to_fits_header_ll(struct gal_fitsarray_header_ll **list,
+                                    int datatype, char *keyname, int kfree,
+                                    void *value, int vfree, char *comment,
+                                    int cfree, char *unit);
 
 void
-gal_fitsarray_add_to_fits_header_ll_end(struct fitsheaderll **list,
+gal_fitsarray_add_to_fits_header_ll_end(struct gal_fitsarray_header_ll **list,
                                         int datatype, char *keyname, int kfree,
                                         void *value, int vfree, char *comment,
                                         int cfree, char *unit);
 
 void
 gal_fitsarray_file_name_in_keywords(char *keynamebase, char *filename,
-                                    struct fitsheaderll **list);
+                                    struct gal_fitsarray_header_ll **list);
 
 void
 gal_fitsarray_add_wcs_to_header(fitsfile *fptr, char *wcsheader, int nkeyrec);
 
 void
-gal_fitsarray_update_keys(fitsfile *fptr, struct fitsheaderll **keylist);
+gal_fitsarray_update_keys(fitsfile *fptr,
+                          struct gal_fitsarray_header_ll **keylist);
 
 void
-gal_fitsarray_copyright_end(fitsfile *fptr, struct fitsheaderll *headers,
-                              char *spack_string);
+gal_fitsarray_copyright_end(fitsfile *fptr,
+                            struct gal_fitsarray_header_ll *headers,
+                            char *spack_string);
 
 
 
@@ -194,7 +197,7 @@ void
 gal_fitsarray_array_to_fits_img(char *filename, char *hdu, int bitpix,
                                 void *array, size_t s0, size_t s1, int 
anyblank,
                                 struct wcsprm *wcs,
-                                struct fitsheaderll *headers,
+                                struct gal_fitsarray_header_ll *headers,
                                 char *spack_string);
 
 void
diff --git a/include/forqsort.h b/include/forqsort.h
index a970cc6..db17220 100644
--- a/include/forqsort.h
+++ b/include/forqsort.h
@@ -25,7 +25,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 /* Pointer used to sort the indexs of an array based on their flux
    (value in this array). */
-extern float *forqsortindexarr;
+extern float *gal_qsort_index_arr;
 
 int
 gal_qsort_index_float_decreasing(const void * a, const void * b);
diff --git a/include/linkedlist.h b/include/linkedlist.h
index 928ff52..1e1b935 100644
--- a/include/linkedlist.h
+++ b/include/linkedlist.h
@@ -26,27 +26,30 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 /******************* Two doubles (for coordinates) */
-struct tdll
+struct gal_linkedlist_tdll
 {
     double a;
     double b;
-    struct tdll *next;
+    struct gal_linkedlist_tdll *next;
 };
 
 void
-gal_linkedlist_add_to_tdll(struct tdll **list, double a, double b);
+gal_linkedlist_add_to_tdll(struct gal_linkedlist_tdll **list,
+                           double a, double b);
 
 void
-gal_linkedlist_pop_from_tdll(struct tdll **list, double *a, double *b);
+gal_linkedlist_pop_from_tdll(struct gal_linkedlist_tdll **list,
+                             double *a, double *b);
 
 size_t
-gal_linkedlist_num_int_dll(struct tdll *list);
+gal_linkedlist_num_int_dll(struct gal_linkedlist_tdll *list);
 
 void
-gal_linkedlist_tdll_to_array_inv(struct tdll *list, double **d, size_t *num);
+gal_linkedlist_tdll_to_array_inv(struct gal_linkedlist_tdll *list,
+                                 double **d, size_t *num);
 
 void
-gal_linkedlist_free_tdll(struct tdll *list);
+gal_linkedlist_free_tdll(struct gal_linkedlist_tdll *list);
 
 
 
@@ -68,32 +71,33 @@ gal_linkedlist_free_tdll(struct tdll *list);
 
 
 /******************* float: */
-struct fll
+struct gal_linkedlist_fll
 {
     float v;
-    struct fll *next;
+    struct gal_linkedlist_fll *next;
 };
 
 void
-gal_linkedlist_print_fll_array(struct fll **afll, size_t num);
+gal_linkedlist_print_fll_array(struct gal_linkedlist_fll **afll, size_t num);
 
 void
-gal_linkedlist_add_to_fll(struct fll **list, float value);
+gal_linkedlist_add_to_fll(struct gal_linkedlist_fll **list, float value);
 
 void
-gal_linkedlist_pop_from_fll(struct fll **list, float *value);
+gal_linkedlist_pop_from_fll(struct gal_linkedlist_fll **list, float *value);
 
 size_t
-gal_linkedlist_num_in_fll(struct fll *list);
+gal_linkedlist_num_in_fll(struct gal_linkedlist_fll *list);
 
 void
-gal_linkedlist_fll_to_array(struct fll *list, float **f, size_t *num);
+gal_linkedlist_fll_to_array(struct gal_linkedlist_fll *list,
+                            float **f, size_t *num);
 
 void
-gal_linkedlist_free_fll(struct fll *list);
+gal_linkedlist_free_fll(struct gal_linkedlist_fll *list);
 
 void
-gal_linkedlist_free_fll_array(struct fll **afll, size_t num);
+gal_linkedlist_free_fll_array(struct gal_linkedlist_fll **afll, size_t num);
 
 
 
@@ -115,22 +119,22 @@ gal_linkedlist_free_fll_array(struct fll **afll, size_t 
num);
 
 
 /******************* String: */
-struct stll
+struct gal_linkedlist_stll
 {
     char *v;
-    struct stll *next;
+    struct gal_linkedlist_stll *next;
 };
 void
-gal_linkedlist_add_to_stll(struct stll **list, char *value);
+gal_linkedlist_add_to_stll(struct gal_linkedlist_stll **list, char *value);
 
 void
-gal_linkedlist_pop_from_stll(struct stll **list, char **value);
+gal_linkedlist_pop_from_stll(struct gal_linkedlist_stll **list, char **value);
 
 void
-gal_linkedlist_print_stll(struct stll *list);
+gal_linkedlist_print_stll(struct gal_linkedlist_stll *list);
 
 size_t
-gal_linkedlist_num_in_stll(struct stll *list);
+gal_linkedlist_num_in_stll(struct gal_linkedlist_stll *list);
 
 
 
@@ -149,29 +153,30 @@ gal_linkedlist_num_in_stll(struct stll *list);
 
 
 /******************* size_t: */
-struct sll
+struct gal_linkedlist_sll
 {
     size_t v;
-    struct sll *next;
+    struct gal_linkedlist_sll *next;
 };
 
 void
-add_to_sll(struct sll **list, size_t value);
+add_to_sll(struct gal_linkedlist_sll **list, size_t value);
 
 void
-pop_from_sll(struct sll **list, size_t *value);
+pop_from_sll(struct gal_linkedlist_sll **list, size_t *value);
 
 size_t
-numinsll(struct sll *list);
+numinsll(struct gal_linkedlist_sll *list);
 
 void
-gal_linkedlist_print_sll(struct sll *list);
+gal_linkedlist_print_sll(struct gal_linkedlist_sll *list);
 
 void
-gal_linkedlist_sll_to_array(struct sll *list, size_t **f, size_t *num);
+gal_linkedlist_sll_to_array(struct gal_linkedlist_sll *list,
+                            size_t **f, size_t *num);
 
 void
-gal_linkedlist_free_sll(struct sll *list);
+gal_linkedlist_free_sll(struct gal_linkedlist_sll *list);
 
 
 
@@ -193,18 +198,20 @@ gal_linkedlist_free_sll(struct sll *list);
 
 
 /******************* Two way size_t: */
-struct tsll
+struct gal_linkedlist_tsll
 {
   size_t v;
-  struct tsll *next;
-  struct tsll *prev;
+  struct gal_linkedlist_tsll *next;
+  struct gal_linkedlist_tsll *prev;
 };
 
 void
-gal_linkedlist_add_to_tsll_end(struct tsll **last, size_t value);
+gal_linkedlist_add_to_tsll_end(struct gal_linkedlist_tsll **last,
+                               size_t value);
 
 void
-gal_linkedlist_pop_from_tsll_start(struct tsll **first,  size_t *value);
+gal_linkedlist_pop_from_tsll_start(struct gal_linkedlist_tsll **first,
+                                   size_t *value);
 
 
 
@@ -226,22 +233,24 @@ gal_linkedlist_pop_from_tsll_start(struct tsll **first,  
size_t *value);
 
 
 /******************* Ordered size_t: */
-struct osll
+struct gal_linkedlist_osll
 {
   size_t v;                    /* The actual value. */
   float s;                     /* The parameter to sort by. */
-  struct osll *next;
+  struct gal_linkedlist_osll *next;
 };
 
 void
-gal_linkedlist_add_to_osll(struct osll **list, size_t value, float tosort);
+gal_linkedlist_add_to_osll(struct gal_linkedlist_osll **list,
+                           size_t value, float tosort);
 
 void
-gal_linkedlist_pop_from_osll(struct osll **list,  size_t *value,
-                             float *sortvalue);
+gal_linkedlist_pop_from_osll(struct gal_linkedlist_osll **list,
+                             size_t *value, float *sortvalue);
 
 void
-gal_linkedlist_osll_into_sll(struct osll *in, struct sll **out);
+gal_linkedlist_osll_into_sll(struct gal_linkedlist_osll *in,
+                             struct gal_linkedlist_sll **out);
 
 
 
@@ -263,33 +272,37 @@ gal_linkedlist_osll_into_sll(struct osll *in, struct sll 
**out);
 
 
 /******************* Two way ordered size_t: */
-struct tosll
+struct gal_linkedlist_tosll
 {
   size_t v;
   float s;
-  struct tosll *prev;
-  struct tosll *next;
+  struct gal_linkedlist_tosll *prev;
+  struct gal_linkedlist_tosll *next;
 };
 
 void
-gal_linkedlist_print_tosll(struct tosll *l, struct tosll *s);
+gal_linkedlist_print_tosll(struct gal_linkedlist_tosll *l,
+                           struct gal_linkedlist_tosll *s);
 
 void
-gal_linkedlist_add_to_tosll_end(struct tosll **largest, struct tosll 
**smallest,
+gal_linkedlist_add_to_tosll_end(struct gal_linkedlist_tosll **largest,
+                                struct gal_linkedlist_tosll **smallest,
                                 size_t value, float tosort);
 
 void
-gal_linkedlist_pop_from_tosll_start(struct tosll **lartest,
-                                    struct tosll **smallest,
+gal_linkedlist_pop_from_tosll_start(struct gal_linkedlist_tosll **lartest,
+                                    struct gal_linkedlist_tosll **smallest,
                                     size_t *value, float *tosort);
 
 void
-gal_linkedlist_smallest_tosll(struct tosll *largest, struct tosll **smallest);
+gal_linkedlist_smallest_tosll(struct gal_linkedlist_tosll *largest,
+                              struct gal_linkedlist_tosll **smallest);
 
 void
-gal_linkedlist_tosll_into_sll(struct tosll *in, struct sll **out);
+gal_linkedlist_tosll_into_sll(struct gal_linkedlist_tosll *in,
+                              struct gal_linkedlist_sll **out);
 
 void
-gal_linkedlist_tosll_free(struct tosll *largest);
+gal_linkedlist_tosll_free(struct gal_linkedlist_tosll *largest);
 
 #endif
diff --git a/include/mesh.h b/include/mesh.h
index 5d5486a..fb423c2 100644
--- a/include/mesh.h
+++ b/include/mesh.h
@@ -46,14 +46,14 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 
-struct meshthreadparams
+struct gal_mesh_thread_params
 {
   /* For convolve: */
   float           *conv; /* The convolved array.                        */
   size_t         *chbrd; /* Bordering x and y values all channels.      */
 
   /* For all: */
-  struct meshparams *mp; /* Pointer to meshparams structure.            */
+  struct gal_mesh_params *mp; /* Pointer to gal_mesh_params structure.  */
   size_t             id; /* The thread ID starting from zero.           */
 };
 
@@ -79,7 +79,7 @@ struct meshthreadparams
    and two nearest arrays. So the garrays have to be used such that
    they are both either valid on one mesh or not.
 */
-struct meshparams
+struct gal_mesh_params
 {
   /* Image: */
   void              *img; /* Input image array.                          */
@@ -154,47 +154,47 @@ struct meshparams
 };
 
 size_t
-gal_mesh_ch_based_id_from_gid(struct meshparams *mp, size_t gid);
+gal_mesh_ch_based_id_from_gid(struct gal_mesh_params *mp, size_t gid);
 
 size_t
-gal_mesh_gid_from_ch_based_id(struct meshparams *mp, size_t chbasedid);
+gal_mesh_gid_from_ch_based_id(struct gal_mesh_params *mp, size_t chbasedid);
 
 size_t
-gal_mesh_img_xy_to_mesh_id(struct meshparams *mp, size_t x, size_t y);
+gal_mesh_img_xy_to_mesh_id(struct gal_mesh_params *mp, size_t x, size_t y);
 
 void
-gal_check_mesh_id(struct meshparams *mp, long **out);
+gal_check_mesh_id(struct gal_mesh_params *mp, long **out);
 
 void
-gal_mesh_check_garray(struct meshparams *mp, float **out1, float **out2);
+gal_mesh_check_garray(struct gal_mesh_params *mp, float **out1, float **out2);
 
 void
-gal_mesh_value_file(struct meshparams *mp, char *filename, char *extname1,
+gal_mesh_value_file(struct gal_mesh_params *mp, char *filename, char *extname1,
                     char *extname2, struct wcsprm *wcs, char *spack_string);
 
 void
-gal_mesh_full_garray(struct meshparams *mp, int reverse);
+gal_mesh_full_garray(struct gal_mesh_params *mp, int reverse);
 
 void
-gal_mesh_make_mesh(struct meshparams *mp);
+gal_mesh_make_mesh(struct gal_mesh_params *mp);
 
 void
-gal_mesh_free_mesh(struct meshparams *mp);
+gal_mesh_free_mesh(struct gal_mesh_params *mp);
 
 void
-gal_mesh_operate_on_mesh(struct meshparams *mp, void *(*meshfunc)(void *),
+gal_mesh_operate_on_mesh(struct gal_mesh_params *mp, void *(*meshfunc)(void *),
                          size_t oneforallsize, int makegarray2, int 
initialize);
 
 void
-gal_mesh_interpolate(struct meshparams *mp, char *errstart);
+gal_mesh_interpolate(struct gal_mesh_params *mp, char *errstart);
 
 void
-gal_mesh_smooth(struct meshparams *mp);
+gal_mesh_smooth(struct gal_mesh_params *mp);
 
 void
-gal_mesh_spatial_convolve_on_mesh(struct meshparams *mp, float **conv);
+gal_mesh_spatial_convolve_on_mesh(struct gal_mesh_params *mp, float **conv);
 
 void
-gal_mesh_change_to_full_convolution(struct meshparams *mp, float *conv);
+gal_mesh_change_to_full_convolution(struct gal_mesh_params *mp, float *conv);
 
 #endif
diff --git a/include/mode.h b/include/mode.h
index 61034f6..4edcd43 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -36,7 +36,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #define GAL_MODE_MIRROR_IS_ABOVE_RESULT    (size_t)(-1)
 
-struct modeparams
+struct gal_mode_params
 {
   float     *sorted;           /* Sorted array to be used.                */
   size_t       size;           /* Number of elements in the sorted array. */
diff --git a/include/spatialconvolve.h b/include/spatialconvolve.h
index 2f85985..77123e0 100644
--- a/include/spatialconvolve.h
+++ b/include/spatialconvolve.h
@@ -35,7 +35,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 /* Main structure: */
-struct sconvparams
+struct gal_spatialconvolve_params
 {
   /* General input parameters: */
   float           *input;     /* Input image array.                    */
@@ -66,7 +66,7 @@ void
 gal_spatialconvolve_pparams(float *input, size_t is0, size_t is1, float 
*kernel,
                             size_t ks0, size_t ks1, size_t nt,
                             int edgecorrection, float *out, size_t *indexs,
-                            struct sconvparams *scp);
+                            struct gal_spatialconvolve_params *scp);
 
 void *
 gal_spatialconvolve_thread(void *inparam);
diff --git a/lib/fitsarrayvv.c b/lib/fitsarrayvv.c
index c55c677..3b26338 100644
--- a/lib/fitsarrayvv.c
+++ b/lib/fitsarrayvv.c
@@ -768,13 +768,14 @@ gal_fitsarray_read_fits_hdu(char *filename, char *hdu, 
int desiredtype,
 
 
 
-/* Read keywords from a FITS file. The readheaderkeys pointer is an
-   array of readheaderkeys structures, which keep the basic
+/* Read keywords from a FITS file. The gal_fitsarray_read_header_keys pointer 
is
+   an array of gal_fitsarray_read_header_keys structures, which keep the basic
    information for each keyword that is to be read and also stores the
    value in the appropriate type.*/
 void
 gal_fitsarray_read_keywords(char *filename, char *hdu,
-                            struct readheaderkeys *keys, size_t num)
+                            struct gal_fitsarray_read_header_keys *keys,
+                            size_t num)
 {
   int status=0;
   char *ffname;
@@ -864,19 +865,19 @@ gal_fitsarray_read_keywords(char *filename, char *hdu,
    it is important to know before hand if they were allocated or
    not. If not, they don't need to be freed. */
 void
-gal_fitsarray_add_to_fits_header_ll(struct fitsheaderll **list, int datatype,
-                                    char *keyname, int kfree, void *value,
-                                    int vfree, char *comment, int cfree,
-                                    char *unit)
+gal_fitsarray_add_to_fits_header_ll(struct gal_fitsarray_header_ll **list,
+                                    int datatype, char *keyname, int kfree,
+                                    void *value, int vfree, char *comment,
+                                    int cfree, char *unit)
 {
-  struct fitsheaderll *newnode;
+  struct gal_fitsarray_header_ll *newnode;
 
   /* Allocate space for the new node and fill it in. */
   errno=0;
   newnode=malloc(sizeof *newnode);
   if(newnode==NULL)
     error(EXIT_FAILURE, errno,
-         "linkedlist: New element in fitsheaderll");
+         "linkedlist: New element in gal_fitsarray_header_ll");
   newnode->datatype=datatype;
   newnode->keyname=keyname;
   newnode->value=value;
@@ -895,19 +896,19 @@ gal_fitsarray_add_to_fits_header_ll(struct fitsheaderll 
**list, int datatype,
 
 
 void
-gal_fitsarray_add_to_fits_header_ll_end(struct fitsheaderll **list,
+gal_fitsarray_add_to_fits_header_ll_end(struct gal_fitsarray_header_ll **list,
                                         int datatype, char *keyname, int kfree,
                                         void *value, int vfree, char *comment,
                                         int cfree, char *unit)
 {
-  struct fitsheaderll *newnode, *tmp;
+  struct gal_fitsarray_header_ll *newnode, *tmp;
 
   /* Allocate space for the new node and fill it in. */
   errno=0;
   newnode=malloc(sizeof *newnode);
   if(newnode==NULL)
     error(EXIT_FAILURE, errno,
-         "linkedlist: New element in fitsheaderll");
+         "linkedlist: New element in gal_fitsarray_header_ll");
   newnode->datatype=datatype;
   newnode->keyname=keyname;
   newnode->value=value;
@@ -937,7 +938,7 @@ gal_fitsarray_add_to_fits_header_ll_end(struct fitsheaderll 
**list,
 
 void
 gal_fitsarray_file_name_in_keywords(char *keynamebase, char *filename,
-                                    struct fitsheaderll **list)
+                                    struct gal_fitsarray_header_ll **list)
 {
   char *keyname, *value;
   size_t numkey=1, maxlength;
@@ -1041,14 +1042,15 @@ gal_fitsarray_add_wcs_to_header(fitsfile *fptr, char 
*wcsheader, int nkeyrec)
 
 
 
-/* Write the keywords in the fitsheaderll linked list to the FITS
+/* Write the keywords in the gal_fitsarray_header_ll linked list to the FITS
    file. Every keyword that is written is freed, that is why we need
    the pointer to the linked list (to correct it after we finish). */
 void
-gal_fitsarray_update_keys(fitsfile *fptr, struct fitsheaderll **keylist)
+gal_fitsarray_update_keys(fitsfile *fptr,
+                          struct gal_fitsarray_header_ll **keylist)
 {
   int status=0;
-  struct fitsheaderll *tmp, *ttmp;
+  struct gal_fitsarray_header_ll *tmp, *ttmp;
 
   tmp=*keylist;
   while(tmp!=NULL)
@@ -1088,7 +1090,8 @@ gal_fitsarray_update_keys(fitsfile *fptr, struct 
fitsheaderll **keylist)
 
 
 void
-gal_fitsarray_copyright_end(fitsfile *fptr, struct fitsheaderll *headers,
+gal_fitsarray_copyright_end(fitsfile *fptr,
+                            struct gal_fitsarray_header_ll *headers,
                             char *spack_string)
 {
   size_t i;
@@ -1355,7 +1358,7 @@ void
 gal_fitsarray_array_to_fits_img(char *filename, char *hdu, int bitpix,
                                 void *array, size_t s0, size_t s1, int 
anyblank,
                                 struct wcsprm *wcs,
-                                struct fitsheaderll *headers,
+                                struct gal_fitsarray_header_ll *headers,
                                 char *spack_string)
 {
   int nkeyrec;
diff --git a/lib/forqsort.c b/lib/forqsort.c
index 857e971..42f1f46 100644
--- a/lib/forqsort.c
+++ b/lib/forqsort.c
@@ -27,13 +27,13 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include "forqsort.h"
 
 /* Initialize the array for sorting indexs to NULL. */
-float *forqsortindexarr;
+float *gal_qsort_index_arr;
 
 int
 gal_qsort_index_float_decreasing(const void * a, const void * b)
 {
-  float ta=forqsortindexarr[ *(size_t *)a ];
-  float tb=forqsortindexarr[ *(size_t *)b ];
+  float ta=gal_qsort_index_arr[ *(size_t *)a ];
+  float tb=gal_qsort_index_arr[ *(size_t *)b ];
   return (tb > ta) - (tb < ta);
 }
 
diff --git a/lib/linkedlist.c b/lib/linkedlist.c
index 3d7e1ab..4b7c7ac 100644
--- a/lib/linkedlist.c
+++ b/lib/linkedlist.c
@@ -43,14 +43,16 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
  *****************        Two doubles        ********************
  ****************************************************************/
 void
-gal_linkedlist_add_to_tdll(struct tdll **list, double a, double b)
+gal_linkedlist_add_to_tdll(struct gal_linkedlist_tdll **list,
+                           double a, double b)
 {
-  struct tdll *newnode;
+  struct gal_linkedlist_tdll *newnode;
 
   errno=0;
   newnode=malloc(sizeof *newnode);
   if(newnode==NULL)
-    error(EXIT_FAILURE, errno, "linkedlist: New element in tdll");
+    error(EXIT_FAILURE, errno, "linkedlist: New element in "
+          "gal_linkedlist_tdll");
 
   newnode->a=a;
   newnode->b=b;
@@ -63,9 +65,10 @@ gal_linkedlist_add_to_tdll(struct tdll **list, double a, 
double b)
 
 
 void
-gal_linkedlist_pop_from_tdll(struct tdll **list, double *a, double *b)
+gal_linkedlist_pop_from_tdll(struct gal_linkedlist_tdll **list,
+                             double *a, double *b)
 {
-  struct tdll *tmp=*list;
+  struct gal_linkedlist_tdll *tmp=*list;
 
   *a=tmp->a;
   *b=tmp->b;
@@ -78,10 +81,10 @@ gal_linkedlist_pop_from_tdll(struct tdll **list, double *a, 
double *b)
 
 
 size_t
-gal_linkedlist_num_int_dll(struct tdll *list)
+gal_linkedlist_num_int_dll(struct gal_linkedlist_tdll *list)
 {
   size_t num=0;
-  struct tdll *tmp;
+  struct gal_linkedlist_tdll *tmp;
   for(tmp=list;tmp!=NULL;tmp=tmp->next)
     ++num;
   return num;
@@ -92,11 +95,12 @@ gal_linkedlist_num_int_dll(struct tdll *list)
 
 
 void
-gal_linkedlist_tdll_to_array_inv(struct tdll *list, double **d, size_t *num)
+gal_linkedlist_tdll_to_array_inv(struct gal_linkedlist_tdll *list,
+                                 double **d, size_t *num)
 {
   size_t i;
   double *td;
-  struct tdll *tmp;
+  struct gal_linkedlist_tdll *tmp;
 
   /* Find the number of elements: */
   if(*num==0)
@@ -107,8 +111,8 @@ gal_linkedlist_tdll_to_array_inv(struct tdll *list, double 
**d, size_t *num)
   errno=0;
   td=*d=malloc(2 * *num * sizeof(double));
   if(*d==NULL)
-    error(EXIT_FAILURE, errno, "linkedlist: array of tdll with %lu "
-         "elements", *num);
+    error(EXIT_FAILURE, errno, "linkedlist: array of gal_linkedlist_tdll "
+          "with %lu elements", *num);
 
   /* Fill in the array in reverse order */
   i = 2 * *num - 2;
@@ -125,9 +129,9 @@ gal_linkedlist_tdll_to_array_inv(struct tdll *list, double 
**d, size_t *num)
 
 
 void
-gal_linkedlist_free_tdll(struct tdll *list)
+gal_linkedlist_free_tdll(struct gal_linkedlist_tdll *list)
 {
-  struct tdll *tmp, *ttmp;
+  struct gal_linkedlist_tdll *tmp, *ttmp;
   tmp=list;
   while(tmp!=NULL)
     {
@@ -160,10 +164,10 @@ gal_linkedlist_free_tdll(struct tdll *list)
  *****************            Float          ********************
  ****************************************************************/
 void
-gal_linkedlist_print_fll_array(struct fll **afll, size_t num)
+gal_linkedlist_print_fll_array(struct gal_linkedlist_fll **afll, size_t num)
 {
   size_t i;
-  struct fll *tmp;
+  struct gal_linkedlist_fll *tmp;
   for(i=0;i<num;++i)
     {
       printf(" %lu:\n", i);
@@ -178,14 +182,14 @@ gal_linkedlist_print_fll_array(struct fll **afll, size_t 
num)
 
 
 void
-gal_linkedlist_add_to_fll(struct fll **list, float value)
+gal_linkedlist_add_to_fll(struct gal_linkedlist_fll **list, float value)
 {
-  struct fll *newnode;
+  struct gal_linkedlist_fll *newnode;
 
   errno=0;
   newnode=malloc(sizeof *newnode);
   if(newnode==NULL)
-    error(EXIT_FAILURE, errno, "linkedlist: New element in fll");
+    error(EXIT_FAILURE, errno, "linkedlist: New element in 
gal_linkedlist_fll");
 
   newnode->v=value;
   newnode->next=*list;
@@ -197,9 +201,9 @@ gal_linkedlist_add_to_fll(struct fll **list, float value)
 
 
 void
-gal_linkedlist_pop_from_fll(struct fll **list, float *value)
+gal_linkedlist_pop_from_fll(struct gal_linkedlist_fll **list, float *value)
 {
-  struct fll *tmp;
+  struct gal_linkedlist_fll *tmp;
   tmp=*list;
   *value=tmp->v;
   *list=tmp->next;
@@ -211,10 +215,10 @@ gal_linkedlist_pop_from_fll(struct fll **list, float 
*value)
 
 
 size_t
-gal_linkedlist_num_in_fll(struct fll *list)
+gal_linkedlist_num_in_fll(struct gal_linkedlist_fll *list)
 {
   size_t num=0;
-  struct fll *tmp;
+  struct gal_linkedlist_fll *tmp;
   for(tmp=list;tmp!=NULL;tmp=tmp->next)
     ++num;
   return num;
@@ -225,11 +229,12 @@ gal_linkedlist_num_in_fll(struct fll *list)
 
 
 void
-gal_linkedlist_fll_to_array(struct fll *list, float **f, size_t *num)
+gal_linkedlist_fll_to_array(struct gal_linkedlist_fll *list,
+                            float **f, size_t *num)
 {
   float *tf;
   size_t i=0;
-  struct fll *tmp;
+  struct gal_linkedlist_fll *tmp;
 
   /* Find the number of elements: */
   if(*num==0)
@@ -239,8 +244,8 @@ gal_linkedlist_fll_to_array(struct fll *list, float **f, 
size_t *num)
   errno=0;
   *f=malloc(*num*sizeof(float));
   if(*f==NULL)
-    error(EXIT_FAILURE, errno, "linkedlist: array of fll with %lu "
-         "elements", *num);
+    error(EXIT_FAILURE, errno, "linkedlist: array of gal_linkedlist_fll "
+          "with %lu elements", *num);
   tf=*f;
 
   /* Fill in the array: */
@@ -253,9 +258,9 @@ gal_linkedlist_fll_to_array(struct fll *list, float **f, 
size_t *num)
 
 
 void
-gal_linkedlist_free_fll(struct fll *list)
+gal_linkedlist_free_fll(struct gal_linkedlist_fll *list)
 {
-  struct fll *tmp, *ttmp;
+  struct gal_linkedlist_fll *tmp, *ttmp;
   tmp=list;
   while(tmp!=NULL)
     {
@@ -270,7 +275,7 @@ gal_linkedlist_free_fll(struct fll *list)
 
 
 void
-gal_linkedlist_free_fll_array(struct fll **afll, size_t num)
+gal_linkedlist_free_fll_array(struct gal_linkedlist_fll **afll, size_t num)
 {
   size_t i;
   for(i=0;i<num;++i)
@@ -301,14 +306,15 @@ gal_linkedlist_free_fll_array(struct fll **afll, size_t 
num)
  *****************           string          ********************
  ****************************************************************/
 void
-gal_linkedlist_add_to_stll(struct stll **list, char *value)
+gal_linkedlist_add_to_stll(struct gal_linkedlist_stll **list, char *value)
 {
-  struct stll *newnode;
+  struct gal_linkedlist_stll *newnode;
 
   errno=0;
   newnode=malloc(sizeof *newnode);
   if(newnode==NULL)
-    error(EXIT_FAILURE, errno, "linkedlist: New element in stll");
+    error(EXIT_FAILURE, errno,
+          "linkedlist: New element in gal_linkedlist_stll");
 
   newnode->v=value;
   newnode->next=*list;
@@ -320,9 +326,9 @@ gal_linkedlist_add_to_stll(struct stll **list, char *value)
 
 
 void
-gal_linkedlist_pop_from_stll(struct stll **list, char **value)
+gal_linkedlist_pop_from_stll(struct gal_linkedlist_stll **list, char **value)
 {
-  struct stll *tmp;
+  struct gal_linkedlist_stll *tmp;
   tmp=*list;
   *value=tmp->v;
   *list=tmp->next;
@@ -334,9 +340,9 @@ gal_linkedlist_pop_from_stll(struct stll **list, char 
**value)
 
 
 void
-gal_linkedlist_print_stll(struct stll *list)
+gal_linkedlist_print_stll(struct gal_linkedlist_stll *list)
 {
-  struct stll *tmp;
+  struct gal_linkedlist_stll *tmp;
   for(tmp=list; tmp!=NULL; tmp=tmp->next)
     printf("%s\n", tmp->v);
 }
@@ -346,10 +352,10 @@ gal_linkedlist_print_stll(struct stll *list)
 
 
 size_t
-gal_linkedlist_num_in_stll(struct stll *list)
+gal_linkedlist_num_in_stll(struct gal_linkedlist_stll *list)
 {
   size_t num=0;
-  struct stll *tmp;
+  struct gal_linkedlist_stll *tmp;
   for(tmp=list;tmp!=NULL;tmp=tmp->next) ++num;
   return num;
 }
@@ -374,14 +380,14 @@ gal_linkedlist_num_in_stll(struct stll *list)
  *****************           size_t          ********************
  ****************************************************************/
 void
-add_to_sll(struct sll **list, size_t value)
+add_to_sll(struct gal_linkedlist_sll **list, size_t value)
 {
-  struct sll *newnode;
+  struct gal_linkedlist_sll *newnode;
 
   errno=0;
   newnode=malloc(sizeof *newnode);
   if(newnode==NULL)
-    error(EXIT_FAILURE, errno, "linkedlist: New element in sll");
+    error(EXIT_FAILURE, errno, "linkedlist: New element in 
gal_linkedlist_sll");
 
   newnode->v=value;
   newnode->next=*list;
@@ -393,9 +399,9 @@ add_to_sll(struct sll **list, size_t value)
 
 
 void
-pop_from_sll(struct sll **list, size_t *value)
+pop_from_sll(struct gal_linkedlist_sll **list, size_t *value)
 {
-  struct sll *tmp;
+  struct gal_linkedlist_sll *tmp;
   tmp=*list;
   *value=tmp->v;
   *list=tmp->next;
@@ -407,10 +413,10 @@ pop_from_sll(struct sll **list, size_t *value)
 
 
 size_t
-numinsll(struct sll *list)
+numinsll(struct gal_linkedlist_sll *list)
 {
   size_t num=0;
-  struct sll *tmp;
+  struct gal_linkedlist_sll *tmp;
   for(tmp=list;tmp!=NULL;tmp=tmp->next)
     ++num;
   return num;
@@ -421,18 +427,19 @@ numinsll(struct sll *list)
 
 
 void
-gal_linkedlist_sll_to_array(struct sll *list, size_t **f, size_t *num)
+gal_linkedlist_sll_to_array(struct gal_linkedlist_sll *list,
+                            size_t **f, size_t *num)
 {
   size_t i=0, *tf;
-  struct sll *tmp;
+  struct gal_linkedlist_sll *tmp;
 
   *num=numinsll(list);
 
   errno=0;
   *f=malloc(*num*sizeof(size_t));
   if(*f==NULL)
-    error(EXIT_FAILURE, errno, "linkedlist: array of sll with %lu "
-         "elements", *num);
+    error(EXIT_FAILURE, errno, "linkedlist: array of gal_linkedlist_sll "
+          "with %lu elements", *num);
   tf=*f;
 
   for(tmp=list;tmp!=NULL;tmp=tmp->next)
@@ -444,9 +451,9 @@ gal_linkedlist_sll_to_array(struct sll *list, size_t **f, 
size_t *num)
 
 
 void
-gal_linkedlist_print_sll(struct sll *list)
+gal_linkedlist_print_sll(struct gal_linkedlist_sll *list)
 {
-  struct sll *tmp;
+  struct gal_linkedlist_sll *tmp;
   printf("\n\n");
   for(tmp=list;tmp!=NULL;tmp=tmp->next)
     printf("%lu, ", tmp->v);
@@ -459,9 +466,9 @@ gal_linkedlist_print_sll(struct sll *list)
 
 
 void
-gal_linkedlist_free_sll(struct sll *list)
+gal_linkedlist_free_sll(struct gal_linkedlist_sll *list)
 {
-  struct sll *tmp, *ttmp;
+  struct gal_linkedlist_sll *tmp, *ttmp;
   tmp=list;
   while(tmp!=NULL)
     {
@@ -496,14 +503,15 @@ gal_linkedlist_free_sll(struct sll *list)
  ****************************************************************/
 
 void
-gal_linkedlist_add_to_tsll_end(struct tsll **last, size_t value)
+gal_linkedlist_add_to_tsll_end(struct gal_linkedlist_tsll **last, size_t value)
 {
-  struct tsll *newnode;
+  struct gal_linkedlist_tsll *newnode;
 
   errno=0;
   newnode=malloc(sizeof *newnode);
   if(newnode==NULL)
-    error(EXIT_FAILURE, errno, "linkedlist: New element in tsll");
+    error(EXIT_FAILURE, errno, "linkedlist: New element in "
+          "gal_linkedlist_tsll");
 
   newnode->v=value;
   newnode->next=*last;
@@ -519,9 +527,10 @@ gal_linkedlist_add_to_tsll_end(struct tsll **last, size_t 
value)
 
 /* Note that start has to be initialized. */
 void
-gal_linkedlist_pop_from_tsll_start(struct tsll **first,  size_t *value)
+gal_linkedlist_pop_from_tsll_start(struct gal_linkedlist_tsll **first,
+                                   size_t *value)
 {
-  struct tsll *tmp;
+  struct gal_linkedlist_tsll *tmp;
   tmp=*first;
   *value=tmp->v;
   *first=tmp->prev;
@@ -556,14 +565,16 @@ gal_linkedlist_pop_from_tsll_start(struct tsll **first,  
size_t *value)
 /* We want to put the nodes in order based on the 'tosort' value of
 each node. The top element should always have the smallest radius. */
 void
-gal_linkedlist_add_to_osll(struct osll **list, size_t value, float tosort)
+gal_linkedlist_add_to_osll(struct gal_linkedlist_osll **list,
+                           size_t value, float tosort)
 {
-  struct osll *newnode, *tmp=*list, *prev=NULL;
+  struct gal_linkedlist_osll *newnode, *tmp=*list, *prev=NULL;
 
   errno=0;
   newnode=malloc(sizeof *newnode);
   if(newnode==NULL)
-    error(EXIT_FAILURE, errno, "linkedlist: New element in osll");
+    error(EXIT_FAILURE, errno, "linkedlist: New element "
+          "in gal_linkedlist_osll");
 
   newnode->v=value;
   newnode->s=tosort;
@@ -598,10 +609,10 @@ gal_linkedlist_add_to_osll(struct osll **list, size_t 
value, float tosort)
 
 /* Note that the popped element is the smallest! */
 void
-gal_linkedlist_pop_from_osll(struct osll **list,  size_t *value,
-                             float *sortvalue)
+gal_linkedlist_pop_from_osll(struct gal_linkedlist_osll **list,
+                             size_t *value, float *sortvalue)
 {
-  struct osll *tmp;
+  struct gal_linkedlist_osll *tmp;
   tmp=*list;
   *value=tmp->v;
   *sortvalue=tmp->s;
@@ -613,11 +624,12 @@ gal_linkedlist_pop_from_osll(struct osll **list,  size_t 
*value,
 
 
 
-/* Add the elements of an osll to a sll. */
+/* Add the elements of an gal_linkedlist_osll to a gal_linkedlist_sll. */
 void
-gal_linkedlist_osll_into_sll(struct osll *in, struct sll **out)
+gal_linkedlist_osll_into_sll(struct gal_linkedlist_osll *in,
+                             struct gal_linkedlist_sll **out)
 {
-  struct osll *tmp;
+  struct gal_linkedlist_osll *tmp;
   while(in!=NULL)
     {
       tmp=in->next;
@@ -663,7 +675,8 @@ gal_linkedlist_osll_into_sll(struct osll *in, struct sll 
**out)
 */
 
 void
-gal_linkedlist_print_tosll(struct tosll *l, struct tosll *s)
+gal_linkedlist_print_tosll(struct gal_linkedlist_tosll *l,
+                           struct gal_linkedlist_tosll *s)
 {
   size_t counter=1;   /* We are not counting array elements :-D ! */
   while(l!=NULL)
@@ -683,15 +696,17 @@ gal_linkedlist_print_tosll(struct tosll *l, struct tosll 
*s)
 
 /* Very similar to Ordered SLL, but now it is two way. */
 void
-gal_linkedlist_add_to_tosll_end(struct tosll **largest, struct tosll 
**smallest,
+gal_linkedlist_add_to_tosll_end(struct gal_linkedlist_tosll **largest,
+                                struct gal_linkedlist_tosll **smallest,
                                 size_t value, float tosort)
 {
-  struct tosll *newnode, *tmp=*largest;
+  struct gal_linkedlist_tosll *newnode, *tmp=*largest;
 
   errno=0;
   newnode=malloc(sizeof *newnode);
   if(newnode==NULL)
-    error(EXIT_FAILURE, errno, "linkedlist: New element in tosll");
+    error(EXIT_FAILURE, errno, "linkedlist: New element "
+          "in gal_linkedlist_tosll");
 
   newnode->v=value;
   newnode->s=tosort;
@@ -737,11 +752,11 @@ gal_linkedlist_add_to_tosll_end(struct tosll **largest, 
struct tosll **smallest,
 
 /* Note that start has to be initialized. */
 void
-gal_linkedlist_pop_from_tosll_start(struct tosll **largest,
-                                    struct tosll **smallest,
+gal_linkedlist_pop_from_tosll_start(struct gal_linkedlist_tosll **largest,
+                                    struct gal_linkedlist_tosll **smallest,
                                     size_t *value, float *tosort)
 {
-  struct tosll *tmp=*smallest;
+  struct gal_linkedlist_tosll *tmp=*smallest;
 
   *value=tmp->v;
   *tosort=tmp->s;
@@ -761,9 +776,10 @@ gal_linkedlist_pop_from_tosll_start(struct tosll **largest,
 
 
 void
-gal_linkedlist_smallest_tosll(struct tosll *largest, struct tosll **smallest)
+gal_linkedlist_smallest_tosll(struct gal_linkedlist_tosll *largest,
+                              struct gal_linkedlist_tosll **smallest)
 {
-  struct tosll *tmp=largest;
+  struct gal_linkedlist_tosll *tmp=largest;
 
   while(tmp!=NULL)
     {
@@ -786,9 +802,10 @@ gal_linkedlist_smallest_tosll(struct tosll *largest, 
struct tosll **smallest)
 
 
 void
-gal_linkedlist_tosll_into_sll(struct tosll *in, struct sll **out)
+gal_linkedlist_tosll_into_sll(struct gal_linkedlist_tosll *in,
+                              struct gal_linkedlist_sll **out)
 {
-  struct tosll *tmp;
+  struct gal_linkedlist_tosll *tmp;
   while(in!=NULL)
     {
       tmp=in->next;
@@ -803,9 +820,9 @@ gal_linkedlist_tosll_into_sll(struct tosll *in, struct sll 
**out)
 
 
 void
-gal_linkedlist_tosll_free(struct tosll *largest)
+gal_linkedlist_tosll_free(struct gal_linkedlist_tosll *largest)
 {
-  struct tosll *tmp;
+  struct gal_linkedlist_tosll *tmp;
   while(largest!=NULL)
     {
       tmp=largest->next;
diff --git a/lib/mesh.c b/lib/mesh.c
index 5386466..27da679 100644
--- a/lib/mesh.c
+++ b/lib/mesh.c
@@ -124,7 +124,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
        know what ID to use for garray.
 */
 size_t
-gal_mesh_ch_based_id_from_gid(struct meshparams *mp, size_t gid)
+gal_mesh_ch_based_id_from_gid(struct gal_mesh_params *mp, size_t gid)
 {
   if(mp->nch==1 || mp->garray1==mp->cgarray1)
     return gid;
@@ -161,7 +161,7 @@ gal_mesh_ch_based_id_from_gid(struct meshparams *mp, size_t 
gid)
 /* Get the garray-based ID from the channel-based ID. See the comments above
    gal_mesh_ch_based_id_from_gid for a complete explanation. */
 size_t
-gal_mesh_gid_from_ch_based_id(struct meshparams *mp, size_t chbasedid)
+gal_mesh_gid_from_ch_based_id(struct gal_mesh_params *mp, size_t chbasedid)
 {
   if(mp->nch==1 || mp->garray1==mp->cgarray1)
     return chbasedid;
@@ -205,7 +205,7 @@ gal_mesh_gid_from_ch_based_id(struct meshparams *mp, size_t 
chbasedid)
        mp->garray[imgindextomeshid(mp, ind)]
  */
 size_t
-gal_mesh_img_xy_to_mesh_id(struct meshparams *mp, size_t x, size_t y)
+gal_mesh_img_xy_to_mesh_id(struct gal_mesh_params *mp, size_t x, size_t y)
 {
   /* Take the proper action. The ternary conditional is here because
      when the meshsize is not an exact multiple of the the channel
@@ -282,7 +282,7 @@ gal_mesh_img_xy_to_mesh_id(struct meshparams *mp, size_t x, 
size_t y)
    equal to 1 (or any non-zero number), then
 */
 void
-gal_mesh_full_garray(struct meshparams *mp, int reverse)
+gal_mesh_full_garray(struct gal_mesh_params *mp, int reverse)
 {
   size_t nch1=mp->nch1;
   size_t ind, gs1=mp->gs1, gs0=mp->gs0;
@@ -381,7 +381,7 @@ gal_mesh_full_garray(struct meshparams *mp, int reverse)
 /*********************************************************************/
 /* Save the meshid of each pixel into an array the size of the image. */
 void
-gal_check_mesh_id(struct meshparams *mp, long **out)
+gal_check_mesh_id(struct gal_mesh_params *mp, long **out)
 {
   long i, *l, *lp;
   size_t row, start, *types=mp->types;
@@ -419,7 +419,7 @@ gal_check_mesh_id(struct meshparams *mp, long **out)
    input image. Note that the check arrays are only the size of the
    number of meshs, not the actual input image size. */
 void
-gal_mesh_check_garray(struct meshparams *mp, float **out1, float **out2)
+gal_mesh_check_garray(struct gal_mesh_params *mp, float **out1, float **out2)
 {
   int ngarrays=mp->ngarrays;
   size_t gid, row, start, chbasedid, *types=mp->types;
@@ -482,7 +482,7 @@ gal_mesh_check_garray(struct meshparams *mp, float **out1, 
float **out2)
 
 /* Save the mesh grid values into an output file. */
 void
-gal_mesh_value_file(struct meshparams *mp, char *filename, char *extname1,
+gal_mesh_value_file(struct gal_mesh_params *mp, char *filename, char *extname1,
                     char *extname2, struct wcsprm *wcs, char *spack_string)
 {
   float *tmp1=NULL, *tmp2=NULL;
@@ -575,7 +575,7 @@ gal_mesh_value_file(struct meshparams *mp, char *filename, 
char *extname1,
    the types are found.
  */
 void
-fillmeshinfo(struct meshparams *mp, size_t chs0, size_t chs1,
+fillmeshinfo(struct gal_mesh_params *mp, size_t chs0, size_t chs1,
              size_t lasts0, size_t lasts1)
 {
   size_t i, j, chi, chj, gs0=mp->gs0, gs1=mp->gs1;
@@ -708,7 +708,7 @@ fillmeshinfo(struct meshparams *mp, size_t chs0, size_t 
chs1,
 
 
 /* In the explanation below, all the parameters named are from the
-   `struct meshparams` of `mesh.h`.
+   `struct gal_mesh_params` of `mesh.h`.
 
    An image contians `s0*s1` pixels in s0 rows and s1 columns. A mesh
    is a box of pixels within the image. A channel is defined as large
@@ -732,7 +732,7 @@ fillmeshinfo(struct meshparams *mp, size_t chs0, size_t 
chs1,
    channel should be interpolated over.
 */
 void
-gal_mesh_make_mesh(struct meshparams *mp)
+gal_mesh_make_mesh(struct gal_mesh_params *mp)
 {
   size_t meshsize=mp->meshsize, lasts0, lasts1;
   size_t i, chs0=mp->s0/mp->nch2, chs1=mp->s1/mp->nch1;
@@ -805,7 +805,7 @@ gal_mesh_make_mesh(struct meshparams *mp)
 
 
 void
-gal_mesh_free_mesh(struct meshparams *mp)
+gal_mesh_free_mesh(struct gal_mesh_params *mp)
 {
   free(mp->start);
   free(mp->types);
@@ -847,7 +847,7 @@ gal_mesh_free_mesh(struct meshparams *mp)
 
    The arguments are:
 
-   1. A pointer to the meshparams structure that keeps all the
+   1. A pointer to the gal_mesh_params structure that keeps all the
       information.
 
    2. A pointer to a function that returns and gets a `void *' as its
@@ -857,7 +857,7 @@ gal_mesh_free_mesh(struct meshparams *mp)
 
    3. The size of each element to copy the mesh grid into, this has to
       be type size of the same type that constitutes `img' in
-      meshparams. If the value to this argument is non-zero, an array
+      gal_mesh_params. If the value to this argument is non-zero, an array
       will be allocated that can contain all the pixels in all the
       meshs and can be used by threads to manipute the pixels (for
       example sort them) in each mesh.
@@ -866,7 +866,7 @@ gal_mesh_free_mesh(struct meshparams *mp)
       allocated in case your operation needs one.
 */
 void
-gal_mesh_operate_on_mesh(struct meshparams *mp, void *(*meshfunc)(void *),
+gal_mesh_operate_on_mesh(struct gal_mesh_params *mp, void *(*meshfunc)(void *),
                          size_t oneforallsize, int makegarray2, int initialize)
 {
   int err;
@@ -874,7 +874,7 @@ gal_mesh_operate_on_mesh(struct meshparams *mp, void 
*(*meshfunc)(void *),
   float *f, *fp;
   pthread_t t; /* We don't use the thread id, so all are saved here. */
   pthread_attr_t attr;
-  struct meshthreadparams *mtp;
+  struct gal_mesh_thread_params *mtp;
   size_t numthreads=mp->numthreads;
 
   /* Allocate the arrays to keep the thread and parameters for each
@@ -918,7 +918,7 @@ gal_mesh_operate_on_mesh(struct meshparams *mp, void 
*(*meshfunc)(void *),
 
      float *oneforall=&mp->oneforall[mtp->id*mp->maxs0*mp->maxs1];
 
-     In meshparams, `oneforall' is defined as a `void *', so the
+     In gal_mesh_params, `oneforall' is defined as a `void *', so the
      caller function, can cast it to any type it wants. The size of
      each type is given to `fillmesh' through the `oneforallsize'
      argument.
@@ -993,7 +993,7 @@ gal_mesh_operate_on_mesh(struct meshparams *mp, void 
*(*meshfunc)(void *),
 /********************         Interpolate         ********************/
 /*********************************************************************/
 void
-preparemeshinterparrays(struct meshparams *mp)
+preparemeshinterparrays(struct gal_mesh_params *mp)
 {
   size_t bs0=mp->gs0, bs1=mp->gs1;
   size_t numthreads=mp->numthreads;
@@ -1088,14 +1088,14 @@ manhattandistance(long ind, long xc, long yc, long s1)
 
 
 
-/* Some of the variables have different names than the meshparams
+/* Some of the variables have different names than the gal_mesh_params
    structure because they are to be fed into the GAL_NEIGHBORS_FILL_4_ALLIMG
    macro. */
 void *
 meshinterponthread(void *inparams)
 {
-  struct meshthreadparams *mtp=(struct meshthreadparams *)inparams;
-  struct meshparams *mp=mtp->mp;
+  struct gal_mesh_thread_params *mtp=(struct gal_mesh_thread_params *)inparams;
+  struct gal_mesh_params *mp=mtp->mp;
 
   /* Basic variables used in other definitions: */
   size_t numnearest=mp->numnearest;
@@ -1103,7 +1103,7 @@ meshinterponthread(void *inparams)
   size_t is1=mp->fullinterpolation ? mp->gs1*mp->nch1 : mp->gs1;
 
   /* Variables for this function: */
-  struct tosll *lQ, *sQ;
+  struct gal_linkedlist_tosll *lQ, *sQ;
   int ngarrays=mp->ngarrays;
   size_t xc, yc, *n, *nf, currentnum, thisind;
   unsigned char *byt=&mp->byt[mtp->id*is0*is1];
@@ -1236,16 +1236,16 @@ meshinterponthread(void *inparams)
 
 
 void
-gal_mesh_interpolate(struct meshparams *mp, char *errstart)
+gal_mesh_interpolate(struct gal_mesh_params *mp, char *errstart)
 {
   int err;
   pthread_t t; /* We don't use the thread id, so all are saved here. */
   size_t i, nb;
   pthread_attr_t attr;
-  struct meshthreadparams *mtp;
+  struct gal_mesh_thread_params *mtp;
   size_t numthreads=mp->numthreads;
 
-  /* Prepare all the meshparams arrays: */
+  /* Prepare all the gal_mesh_params arrays: */
   mp->errstart=errstart;
   preparemeshinterparrays(mp);
 
@@ -1343,7 +1343,7 @@ gal_mesh_interpolate(struct meshparams *mp, char 
*errstart)
 /********************           Smooth            ********************/
 /*********************************************************************/
 void
-gal_mesh_smooth(struct meshparams *mp)
+gal_mesh_smooth(struct gal_mesh_params *mp)
 {
   float *charray;
   float *f, *o, *fp, *tmp, *kernel, *sgarray1, *sgarray2;
@@ -1444,8 +1444,8 @@ gal_mesh_smooth(struct meshparams *mp)
 void*
 meshspatialconvonthreads(void *inparam)
 {
-  struct meshthreadparams *mtp = (struct meshthreadparams *) inparam;
-  struct meshparams *mp = mtp->mp;
+  struct gal_mesh_thread_params *mtp = (struct gal_mesh_thread_params 
*)inparam;
+  struct gal_mesh_params *mp = mtp->mp;
   const size_t ks0=mp->ks0, ks1=mp->ks1, is1=mp->s1;
 
   double sum, ksum;
@@ -1551,13 +1551,13 @@ meshspatialconvonthreads(void *inparam)
 
 
 void
-gal_mesh_spatial_convolve_on_mesh(struct meshparams *mp, float **conv)
+gal_mesh_spatial_convolve_on_mesh(struct gal_mesh_params *mp, float **conv)
 {
   int err;
   pthread_t t; /* We don't use the thread id, so all are saved here. */
   pthread_attr_t attr;
   size_t i, nb, *chbrd;
-  struct meshthreadparams *mtp;
+  struct gal_mesh_thread_params *mtp;
   size_t numthreads=mp->numthreads;
 
 
@@ -1662,7 +1662,7 @@ gal_mesh_spatial_convolve_on_mesh(struct meshparams *mp, 
float **conv)
    gal_mesh_change_to_full_convolution, where it is explained how to count the
    number of pixels that should be re-convolved. */
 void
-corrconvindexs(struct meshparams *mp, size_t **indexs, size_t *numpix,
+corrconvindexs(struct gal_mesh_params *mp, size_t **indexs, size_t *numpix,
                size_t *thrdcols)
 {
   size_t i, j, a, b;
@@ -1791,13 +1791,13 @@ corrconvindexs(struct meshparams *mp, size_t **indexs, 
size_t *numpix,
    the indexs are not over the full image but only a select number of pixels.
 */
 void
-gal_mesh_change_to_full_convolution(struct meshparams *mp, float *conv)
+gal_mesh_change_to_full_convolution(struct gal_mesh_params *mp, float *conv)
 {
   int err;
   pthread_t t;          /* All thread ids saved in this, not used. */
   pthread_attr_t attr;
   pthread_barrier_t b;
-  struct sconvparams *scp;
+  struct gal_spatialconvolve_params *scp;
   size_t i, nb, *indexs, numpix, thrdcols;
 
   /* If convolution was done over the full image, then there is
diff --git a/lib/mode.c b/lib/mode.c
index bc68997..1c2aedd 100644
--- a/lib/mode.c
+++ b/lib/mode.c
@@ -356,7 +356,7 @@ mirrormaxdiff(float *a, size_t size, size_t m,
    fourth point to be placed between. With this configuration, the probing 
point
    is located at: */
 size_t
-modegoldenselection(struct modeparams *mp)
+modegoldenselection(struct gal_mode_params *mp)
 {
   size_t di, dd;
   /*static int counter=1;*/
@@ -560,9 +560,9 @@ void
 gal_mode_index_in_sorted(float *sorted, size_t size, float errorstdm,
                          size_t *modeindex, float *modesym)
 {
-  struct modeparams mp;
+  struct gal_mode_params mp;
 
-  /* Initialize the modeparams structure: */
+  /* Initialize the gal_mode_params structure: */
   mp.size=size;
   mp.sorted=sorted;
   mp.tolerance=0.01;
diff --git a/lib/spatialconvolve.c b/lib/spatialconvolve.c
index 46ea03d..178063a 100644
--- a/lib/spatialconvolve.c
+++ b/lib/spatialconvolve.c
@@ -49,7 +49,7 @@ void
 gal_spatialconvolve_pparams(float *input, size_t is0, size_t is1, float 
*kernel,
                             size_t ks0, size_t ks1, size_t nt,
                             int edgecorrection, float *out, size_t *indexs,
-                            struct sconvparams *scp)
+                            struct gal_spatialconvolve_params *scp)
 {
   /* Put the simple values in: */
   scp->is0=is0;
@@ -72,7 +72,8 @@ gal_spatialconvolve_pparams(float *input, size_t is0, size_t 
is1, float *kernel,
 void *
 gal_spatialconvolve_thread(void *inparam)
 {
-  struct sconvparams *scp=(struct sconvparams *)inparam;
+  struct gal_spatialconvolve_params *scp=
+    (struct gal_spatialconvolve_params *)inparam;
 
   double sum, ksum;
   long naxes[2]={scp->is1, scp->is0};
@@ -168,7 +169,7 @@ gal_spatialconvolve_convolve(float *input, size_t is0, 
size_t is1,
   pthread_t t;          /* All thread ids saved in this, not used. */
   pthread_attr_t attr;
   pthread_barrier_t b;
-  struct sconvparams *scp;
+  struct gal_spatialconvolve_params *scp;
   size_t i, nb, *indexs, thrdcols;
 
 
diff --git a/src/convertt/main.h b/src/convertt/main.h
index 4bf538f..649ba04 100644
--- a/src/convertt/main.h
+++ b/src/convertt/main.h
@@ -93,11 +93,11 @@ struct uiparams
 struct converttparams
 {
   /* Before actual program: */
-  struct   commonparams  cp;  /* Common parameters.                    */
+  struct gal_commonparams cp; /* Common parameters.                    */
   struct       uiparams  up;  /* User interface parameters.            */
 
   /* Input: */
-  struct stll   *inputnames;  /* The names of input files.             */
+  struct gal_linkedlist_stll *inputnames; /* The names of input files. */
   size_t          numinputs;  /* Number of input files.                */
   int             inputtype;  /* The type of the input file.           */
 
diff --git a/src/convertt/ui.c b/src/convertt/ui.c
index b87be76..0731eaa 100644
--- a/src/convertt/ui.c
+++ b/src/convertt/ui.c
@@ -66,7 +66,7 @@ readconfig(char *filename, struct converttparams *p)
   size_t lineno=0, len=200;
   char *line, *name, *value;
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
   char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
@@ -185,7 +185,7 @@ void
 printvalues(FILE *fp, struct converttparams *p)
 {
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   /* Print all the options that are set. Separate each group with a
      commented line explaining the options in that group. */
@@ -236,7 +236,7 @@ void
 checkifset(struct converttparams *p)
 {
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   int intro=0;
   if(cp->hduset==0)
@@ -359,7 +359,7 @@ void
 adddotautomaticoutput(struct converttparams *p)
 {
   size_t i;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
   char *tmp, *basename="output.txt";
 
   /* Find the first file name in the input(s). */
@@ -398,7 +398,7 @@ void
 sanitycheck(struct converttparams *p)
 {
   size_t i, j;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   /* The flux range: */
   if(p->fluxlow>p->fluxhigh)
@@ -553,7 +553,7 @@ preparearrays(struct converttparams *p)
   size_t i;
   void *array;
   double *d, *df;
-  struct stll *tmp;
+  struct gal_linkedlist_stll *tmp;
   char *hdu=NULL, **names=p->names;
 
   /* Put the names in the correct order. */
@@ -679,7 +679,7 @@ preparearrays(struct converttparams *p)
 void
 setparams(int argc, char *argv[], struct converttparams *p)
 {
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   /* Set the non-zero initial values, the structure was initialized to
      have a zero value for all elements. */
@@ -737,7 +737,7 @@ void
 freeandreport(struct converttparams *p)
 {
   size_t i;
-  struct stll *tmp, *ttmp;
+  struct gal_linkedlist_stll *tmp, *ttmp;
 
   free(p->cp.hdu);
   free(p->up.hdu2);
diff --git a/src/convolve/convolve.c b/src/convolve/convolve.c
index f219e29..267cbbe 100644
--- a/src/convolve/convolve.c
+++ b/src/convolve/convolve.c
@@ -749,7 +749,7 @@ convolve(struct convolveparams *p)
 {
   float *convolved;
   long *meshindexs;
-  struct meshparams *mp=&p->mp;
+  struct gal_mesh_params *mp=&p->mp;
 
   /* Do the convolution. */
   if(p->spatial)
diff --git a/src/convolve/main.h b/src/convolve/main.h
index 57cfd5d..5c38826 100644
--- a/src/convolve/main.h
+++ b/src/convolve/main.h
@@ -78,8 +78,8 @@ struct uiparams
 struct convolveparams
 {
   struct uiparams     up;   /* user interface structure.                */
-  struct commonparams cp;   /* commonparams structure.                  */
-  struct meshparams   mp;   /* meshparams structure.                    */
+  struct gal_commonparams cp; /* gal_commonparams structure.            */
+  struct gal_mesh_params mp; /* gal_mesh_params structure.              */
 
   /* Inputs: */
   int         makekernel;   /* ==1: Make a kernel to create input.      */
diff --git a/src/convolve/ui.c b/src/convolve/ui.c
index 839ec95..27082df 100644
--- a/src/convolve/ui.c
+++ b/src/convolve/ui.c
@@ -65,7 +65,7 @@ readconfig(char *filename, struct convolveparams *p)
   size_t lineno=0, len=200;
   char *line, *name, *value;
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
   int zeroorone, spatialset=0, frequencyset=0;
   char key='a';        /* Not used, just a place holder. */
 
@@ -224,8 +224,8 @@ void
 printvalues(FILE *fp, struct convolveparams *p)
 {
   struct uiparams *up=&p->up;
-  struct meshparams *mp=&p->mp;
-  struct commonparams *cp=&p->cp;
+  struct gal_mesh_params *mp=&p->mp;
+  struct gal_commonparams *cp=&p->cp;
 
   fprintf(fp, "\n# Input:\n");
   if(cp->hduset)
@@ -281,7 +281,7 @@ void
 checkifset(struct convolveparams *p)
 {
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   int intro=0;
 
@@ -416,7 +416,7 @@ preparearrays(struct convolveparams *p)
   size_t i, size;
   int bitpix, anyblank;
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
   float *f, *fp, tmp, *kernel, sum;
 
   /* First read the input image: */
@@ -539,7 +539,7 @@ preparearrays(struct convolveparams *p)
 void
 setparams(int argc, char *argv[], struct convolveparams *p)
 {
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   /* Set the non-zero initial values, the structure was initialized to
      have a zero value for all elements. */
diff --git a/src/header/header.c b/src/header/header.c
index c8964c1..4e32fa5 100644
--- a/src/header/header.c
+++ b/src/header/header.c
@@ -79,10 +79,11 @@ haserror(struct headerparams *p, int actionid, char 
*string, int status)
 
 
 void
-writeupdatekeys(fitsfile *fptr, struct fitsheaderll **keylist, int u1w2)
+writeupdatekeys(fitsfile *fptr, struct gal_fitsarray_header_ll **keylist,
+                int u1w2)
 {
   int status=0;
-  struct fitsheaderll *tmp, *ttmp;
+  struct gal_fitsarray_header_ll *tmp, *ttmp;
 
   tmp=*keylist;
   while(tmp!=NULL)
@@ -157,7 +158,7 @@ header(struct headerparams *p)
   int r=EXIT_SUCCESS;
   int nkeys, status=0;
   char *fullheader, *c, *cf;
-  struct stll *tstll, *ttstll;
+  struct gal_linkedlist_stll *tstll, *ttstll;
 
   if(p->onlyview)
     {
diff --git a/src/header/main.h b/src/header/main.h
index 66e1517..a833889 100644
--- a/src/header/main.h
+++ b/src/header/main.h
@@ -39,10 +39,10 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 struct uiparams
 {
-  char             *inputname;  /* Name of input file.               */
-  struct stll         *rename;  /* Rename a keyword.                 */
-  struct stll         *update;  /* For keywords to update.           */
-  struct stll          *write;  /* Full argument for keywords to add.*/
+  char                     *inputname;  /* Name of input file.               */
+  struct gal_linkedlist_stll  *rename;  /* Rename a keyword.                 */
+  struct gal_linkedlist_stll  *update;  /* For keywords to update.           */
+  struct gal_linkedlist_stll   *write;  /* Full argument for keywords to add.*/
 };
 
 
@@ -53,7 +53,7 @@ struct headerparams
 {
   /* Other structures: */
   struct uiparams          up;  /* User interface parameters.         */
-  struct commonparams      cp;  /* Common parameters.                 */
+  struct gal_commonparams  cp;  /* Common parameters.                 */
 
   /* Input: */
   int                    nwcs;  /* Number of WCS structures.          */
@@ -64,12 +64,12 @@ struct headerparams
   int                    date;  /* Set DATE to current time.          */
   char               *comment;  /* COMMENT value.                     */
   char               *history;  /* HISTORY value.                     */
-  struct stll           *asis;  /* Strings to write as is into header.*/
-  struct stll         *delete;  /* Keywords to remove.                */
-  struct stll     *renamefrom;  /* The initial value of the keyword.  */
-  struct stll       *renameto;  /* The final value of the keyword.    */
-  struct fitsheaderll *update;  /* Linked list of keywords to update. */
-  struct fitsheaderll  *write;  /* Linked list of keywords to add.    */
+  struct gal_linkedlist_stll *asis; /* Strings to write as is into header.*/
+  struct gal_linkedlist_stll *delete; /* Keywords to remove.          */
+  struct gal_linkedlist_stll *renamefrom; /* The initial value of the keyword. 
*/
+  struct gal_linkedlist_stll *renameto; /* The final value of the keyword. */
+  struct gal_fitsarray_header_ll *update; /* Linked list of keywords to 
update. */
+  struct gal_fitsarray_header_ll *write; /* Linked list of keywords to add. */
 
   /* Operating mode: */
   int             quitonerror;  /* Quit if an error occurs.           */
diff --git a/src/header/ui.c b/src/header/ui.c
index 1b4d78a..8ab2415 100644
--- a/src/header/ui.c
+++ b/src/header/ui.c
@@ -69,7 +69,7 @@ readconfig(char *filename, struct headerparams *p)
   size_t lineno=0, len=200;
   char *line, *name, *value;
   /*struct uiparams *up=&p->up;*/
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
   char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
@@ -139,7 +139,7 @@ void
 printvalues(FILE *fp, struct headerparams *p)
 {
   /*struct uiparams *up=&p->up;*/
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
 
   /* Print all the options that are set. Separate each group with a
@@ -167,7 +167,7 @@ void
 checkifset(struct headerparams *p)
 {
   /*struct uiparams *up=&p->up;*/
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   int intro=0;
   if(cp->hduset==0)
@@ -234,7 +234,7 @@ void
 setuprename(struct headerparams *p)
 {
   char *c;
-  struct stll *tmp;
+  struct gal_linkedlist_stll *tmp;
 
   for(tmp=p->up.rename; tmp!=NULL; tmp=tmp->next)
     {
@@ -258,7 +258,7 @@ setuprename(struct headerparams *p)
     }
   /*
   {
-    struct stll *tmp2=p->renameto;
+    struct gal_linkedlist_stll *tmp2=p->renameto;
     for(tmp=p->renamefrom; tmp!=NULL; tmp=tmp->next)
       {
         printf("%s to %s\n", tmp->v, tmp2->v);
@@ -273,12 +273,13 @@ setuprename(struct headerparams *p)
 
 
 void
-fillfitsheaderll(struct stll *input, struct fitsheaderll **output)
+fillfitsheaderll(struct gal_linkedlist_stll *input,
+                 struct gal_fitsarray_header_ll **output)
 {
   long l, *lp;
   void *fvalue;
   double d, *dp;
-  struct stll *tmp;
+  struct gal_linkedlist_stll *tmp;
   int i=0, datatype, vfree;
   char *c, *cf, *start, *tailptr;
   char *original, *keyname, *value, *comment, *unit;
@@ -449,7 +450,7 @@ preparearrays(struct headerparams *p)
 void
 setparams(int argc, char *argv[], struct headerparams *p)
 {
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   /* Set the non-zero initial values, the structure was initialized to
      have a zero value for all elements. */
diff --git a/src/imgcrop/args.h b/src/imgcrop/args.h
index 06ace1e..e5d1906 100644
--- a/src/imgcrop/args.h
+++ b/src/imgcrop/args.h
@@ -460,7 +460,7 @@ parse_opt(int key, char *arg, struct argp_state *state)
       /* See what type of input value it is and put it in. */
       if( gal_fitsarray_name_is_fits(arg) )
        {
-         gal_linkedlist_add_to_stll(&p->up.stll, arg);
+         gal_linkedlist_add_to_stll(&p->up.gal_linkedlist_stll, arg);
          ++p->numimg;
        }
       else
@@ -491,7 +491,7 @@ parse_opt(int key, char *arg, struct argp_state *state)
                                      || p->up.sectionset
                                       || p->up.polygonset))
            argp_error(state, "No catalog provided!");
-         if(p->up.stll==NULL)
+         if(p->up.gal_linkedlist_stll==NULL)
            argp_error(state, "No FITS image(s) provided!");
        }
       break;
diff --git a/src/imgcrop/crop.c b/src/imgcrop/crop.c
index d6fac40..bda5255 100644
--- a/src/imgcrop/crop.c
+++ b/src/imgcrop/crop.c
@@ -175,7 +175,7 @@ polygonparser(struct imgcropparams *p)
   size_t dim=0;
   char *tailptr;
   double read[2], *array;
-  struct tdll *tdll=NULL;
+  struct gal_linkedlist_tdll *gal_linkedlist_tdll=NULL;
   char *pt=p->up.polygon;
 
   /* Parse the string. */
@@ -224,7 +224,7 @@ polygonparser(struct imgcropparams *p)
           /* If this was the second dimension, then put the values
              into the linked list: */
           if(dim==1)
-            gal_linkedlist_add_to_tdll(&tdll, read[0], read[1]);
+            gal_linkedlist_add_to_tdll(&gal_linkedlist_tdll, read[0], read[1]);
 
           /* The job here is done, start from tailptr */
           pt=tailptr;
@@ -232,7 +232,7 @@ polygonparser(struct imgcropparams *p)
     }
 
   /* Convert the linked list to an array: */
-  gal_linkedlist_tdll_to_array_inv(tdll, &array, &p->nvertices);
+  gal_linkedlist_tdll_to_array_inv(gal_linkedlist_tdll, &array, &p->nvertices);
   if(p->imgmode) { p->ipolygon=array; p->wpolygon=NULL;  }
   else           { p->ipolygon=NULL;  p->wpolygon=array; }
 
@@ -248,7 +248,7 @@ polygonparser(struct imgcropparams *p)
   */
 
   /* Clean up: */
-  gal_linkedlist_free_tdll(tdll);
+  gal_linkedlist_free_tdll(gal_linkedlist_tdll);
 }
 
 
@@ -451,7 +451,7 @@ void
 cropname(struct cropparams *crp)
 {
   struct imgcropparams *p=crp->p;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
   struct imgcroplog *log=&crp->p->log[crp->outindex];
 
   /* Set the output name and crop sides: */
@@ -676,7 +676,7 @@ onecrop(struct cropparams *crp)
   char basename[FLEN_KEYWORD];
   long fpixel_i[2] , lpixel_i[2];
   fitsfile *ifp=crp->infits, *ofp;
-  struct fitsheaderll *headers=NULL;
+  struct gal_fitsarray_header_ll *headers=NULL;
   int status=0, anynul=0, bitpix=p->bitpix;
   long fpixel_o[2], lpixel_o[2], inc[2]={1,1};
   char region[FLEN_VALUE], regionkey[FLEN_KEYWORD];
diff --git a/src/imgcrop/imgcrop.c b/src/imgcrop/imgcrop.c
index 9d9f165..fd0c40c 100644
--- a/src/imgcrop/imgcrop.c
+++ b/src/imgcrop/imgcrop.c
@@ -47,7 +47,7 @@ imgmodecrop(void *inparam)
 {
   struct cropparams *crp=(struct cropparams *)inparam;
   struct imgcropparams *p=crp->p;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   size_t i;
   int status;
diff --git a/src/imgcrop/main.h b/src/imgcrop/main.h
index 09674aa..2b6acec 100644
--- a/src/imgcrop/main.h
+++ b/src/imgcrop/main.h
@@ -78,7 +78,7 @@ struct inputimgs
 struct uiparams
 {
   char      *catname;  /* Catalog file name.                            */
-  struct stll  *stll;  /* Linked list keeping input file names.         */
+  struct gal_linkedlist_stll *gal_linkedlist_stll; /* Linked list keeping 
input file names. */
   char      *polygon;  /* String of input polygon vertices.             */
 
   /* Check if all parameters are read (use .def file for
@@ -115,7 +115,7 @@ struct uiparams
 struct imgcropparams
 {
   /* Before actual program: */
-  struct commonparams cp;  /* Common parameters.                       */
+  struct gal_commonparams cp; /* Common parameters.                    */
   struct uiparams     up;  /* User interface parameters.               */
 
   /* Operating modes: */
diff --git a/src/imgcrop/ui.c b/src/imgcrop/ui.c
index 7fac62b..4c67b78 100644
--- a/src/imgcrop/ui.c
+++ b/src/imgcrop/ui.c
@@ -71,7 +71,7 @@ readconfig(char *filename, struct imgcropparams *p)
   char *line, *name, *value;
   struct uiparams *up=&p->up;
   size_t lineno=0, len=200, tmp;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
   char key='a';        /* Not used, just a place holder. */
   int imgmodeset=0, wcsmodeset=0; /* For unambiguous default file checking. */
 
@@ -255,7 +255,7 @@ void
 printvalues(FILE *fp, struct imgcropparams *p)
 {
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   /* Print all the options that are set. Separate each group with a
      commented line explaining the options in that group. */
@@ -314,7 +314,7 @@ void
 checkifset(struct imgcropparams *p)
 {
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   int intro=0;
   if(up->imgmodeset==0 && up->wcsmodeset==0)
@@ -370,7 +370,7 @@ sanitycheck(struct imgcropparams *p)
   int checksum;
   char forerr[100];
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
 
 
@@ -618,7 +618,7 @@ preparearrays(struct imgcropparams *p)
       /* Get the image properties. */
       status=0;
       img=&p->imgs[i];
-      gal_linkedlist_pop_from_stll(&p->up.stll, &img->name);
+      gal_linkedlist_pop_from_stll(&p->up.gal_linkedlist_stll, &img->name);
       gal_fitsarray_read_fits_hdu(img->name, p->cp.hdu, IMAGE_HDU, &tmpfits);
       gal_fitsarray_img_bitpix_size(tmpfits, &p->bitpix, img->naxes);
       gal_fitsarray_read_wcs(tmpfits, &img->nwcs, &img->wcs, p->hstartwcs,
@@ -705,7 +705,7 @@ preparearrays(struct imgcropparams *p)
 void
 setparams(int argc, char *argv[], struct imgcropparams *p)
 {
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   /* Set the non-zero initial values, the structure was initialized to
      have a zero value for all elements. */
diff --git a/src/imgstat/main.h b/src/imgstat/main.h
index da275f0..0493b38 100644
--- a/src/imgstat/main.h
+++ b/src/imgstat/main.h
@@ -78,7 +78,7 @@ struct imgstatparams
 {
   /* Other structures: */
   struct uiparams       up;  /* User interface parameters.              */
-  struct commonparams   cp;  /* Common parameters.                      */
+  struct gal_commonparams cp; /* Common parameters.                     */
 
   /* Input: */
   float               *img;  /* Input image array.                      */
diff --git a/src/imgstat/ui.c b/src/imgstat/ui.c
index 0632b97..03b503b 100644
--- a/src/imgstat/ui.c
+++ b/src/imgstat/ui.c
@@ -73,7 +73,7 @@ readconfig(char *filename, struct imgstatparams *p)
   size_t lineno=0, len=200;
   char *line, *name, *value;
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
   char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
@@ -248,7 +248,7 @@ void
 printvalues(FILE *fp, struct imgstatparams *p)
 {
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   /* Print all the options that are set. Separate each group with a
      commented line explaining the options in that group. */
@@ -322,7 +322,7 @@ void
 checkifset(struct imgstatparams *p)
 {
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   int intro=0;
   if(cp->hduset==0)
@@ -621,7 +621,7 @@ preparearrays(struct imgstatparams *p)
 void
 setparams(int argc, char *argv[], struct imgstatparams *p)
 {
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   /* Set the non-zero initial values, the structure was initialized to
      have a zero value for all elements. */
diff --git a/src/imgwarp/imgwarp.c b/src/imgwarp/imgwarp.c
index c6d6e8a..6fab887 100644
--- a/src/imgwarp/imgwarp.c
+++ b/src/imgwarp/imgwarp.c
@@ -427,7 +427,7 @@ correctwcssaveoutput(struct imgwarpparams *p)
   void *array;
   double *m=p->matrix;
   char keyword[9*FLEN_KEYWORD];
-  struct fitsheaderll *headers=NULL;
+  struct gal_fitsarray_header_ll *headers=NULL;
   double tpc[4], tcrpix[3], *crpix=p->wcs->crpix, *pc=p->wcs->pc;
   double tinv[4]={p->inverse[0]/p->inverse[8], p->inverse[1]/p->inverse[8],
                   p->inverse[3]/p->inverse[8], p->inverse[4]/p->inverse[8]};
diff --git a/src/imgwarp/main.h b/src/imgwarp/main.h
index 583177d..12d3f6f 100644
--- a/src/imgwarp/main.h
+++ b/src/imgwarp/main.h
@@ -64,7 +64,7 @@ struct imgwarpparams
 {
   /* Other structures: */
   struct uiparams     up;  /* User interface parameters.                 */
-  struct commonparams cp;  /* Common parameters.                         */
+  struct gal_commonparams cp; /* Common parameters.                      */
 
   /* Input: */
   double           *input;  /* Name of input FITS file.                  */
diff --git a/src/imgwarp/ui.c b/src/imgwarp/ui.c
index fb4d98d..bdf4c43 100644
--- a/src/imgwarp/ui.c
+++ b/src/imgwarp/ui.c
@@ -68,7 +68,7 @@ readconfig(char *filename, struct imgwarpparams *p)
   size_t lineno=0, len=200;
   char *line, *name, *value;
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
   char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
@@ -160,7 +160,7 @@ void
 printvalues(FILE *fp, struct imgwarpparams *p)
 {
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   /* Print all the options that are set. Separate each group with a
      commented line explaining the options in that group. */
@@ -201,7 +201,7 @@ void
 checkifset(struct imgwarpparams *p)
 {
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   int intro=0;
   if(cp->hduset==0)
@@ -467,7 +467,7 @@ preparearrays(struct imgwarpparams *p)
 void
 setparams(int argc, char *argv[], struct imgwarpparams *p)
 {
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   /* Set the non-zero initial values, the structure was initialized to
      have a zero value for all elements. */
diff --git a/src/mkcatalog/main.h b/src/mkcatalog/main.h
index 7502df3..c18e29c 100644
--- a/src/mkcatalog/main.h
+++ b/src/mkcatalog/main.h
@@ -210,7 +210,7 @@ struct mkcatalogparams
 {
   /* Other structures: */
   struct uiparams          up;  /* User interface parameters.         */
-  struct commonparams      cp;  /* Common parameters.                 */
+  struct gal_commonparams  cp;  /* Common parameters.                 */
 
   /* Input: */
   float                  *img;  /* Input image.                       */
@@ -243,7 +243,7 @@ struct mkcatalogparams
   double               *cinfo;  /* Information for all the clumps.    */
   size_t           numobjects;  /* Total number of objects.           */
   size_t            numclumps;  /* Total number of clumps.            */
-  struct sll       *allcolsll;  /* All the input columns.             */
+  struct gal_linkedlist_sll *allcolsll; /* All the input columns.     */
   size_t             *allcols;  /* Array keeping all the input cols.  */
   size_t             allncols;  /* Total number of input columns.     */
   size_t             *objcols;  /* Array of objcolsll.                */
diff --git a/src/mkcatalog/ui.c b/src/mkcatalog/ui.c
index ff15ca0..aec7635 100644
--- a/src/mkcatalog/ui.c
+++ b/src/mkcatalog/ui.c
@@ -70,7 +70,7 @@ readconfig(char *filename, struct mkcatalogparams *p)
   size_t lineno=0, len=200;
   char *line, *name, *value;
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
   char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
@@ -421,7 +421,7 @@ printvalues(FILE *fp, struct mkcatalogparams *p)
 {
   int i;
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
 
   /* Print all the options that are set. Separate each group with a
@@ -572,7 +572,7 @@ void
 checkifset(struct mkcatalogparams *p)
 {
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   int intro=0;
   if(cp->hduset==0)
@@ -632,7 +632,7 @@ checkifset(struct mkcatalogparams *p)
 void
 sanitycheck(struct mkcatalogparams *p)
 {
-  struct readheaderkeys keys[2];
+  struct gal_fitsarray_read_header_keys keys[2];
 
   /* Set the names of the files. */
   gal_fitsarray_file_or_ext_name(p->up.inputname, p->cp.hdu, p->up.masknameset,
@@ -961,7 +961,7 @@ preparearrays(struct mkcatalogparams *p)
 void
 setparams(int argc, char *argv[], struct mkcatalogparams *p)
 {
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   /* Set the non-zero initial values, the structure was initialized to
      have a zero value for all elements. */
diff --git a/src/mknoise/main.h b/src/mknoise/main.h
index cb5663f..928aa8f 100644
--- a/src/mknoise/main.h
+++ b/src/mknoise/main.h
@@ -58,7 +58,7 @@ struct mknoiseparams
 {
   /* Other structures: */
   struct uiparams     up;  /* User interface parameters.               */
-  struct commonparams cp;  /* Common parameters.                       */
+  struct gal_commonparams cp; /* Common parameters.                    */
 
   /* Input: */
   int            envseed;  /* ==1, generate a random seed.             */
diff --git a/src/mknoise/mknoise.c b/src/mknoise/mknoise.c
index 07e292e..a86a1c2 100644
--- a/src/mknoise/mknoise.c
+++ b/src/mknoise/mknoise.c
@@ -54,7 +54,7 @@ void
 convertsaveoutput(struct mknoiseparams *p)
 {
   void *array;
-  struct fitsheaderll *headers=NULL;
+  struct gal_fitsarray_header_ll *headers=NULL;
   char keyname1[FLEN_KEYWORD], keyname2[FLEN_KEYWORD];
   char keyname3[FLEN_KEYWORD], keyname4[FLEN_KEYWORD], keyname5[FLEN_KEYWORD];
 
diff --git a/src/mknoise/ui.c b/src/mknoise/ui.c
index a257a6e..942b099 100644
--- a/src/mknoise/ui.c
+++ b/src/mknoise/ui.c
@@ -69,7 +69,7 @@ readconfig(char *filename, struct mknoiseparams *p)
   size_t lineno=0, len=200;
   char *line, *name, *value;
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
   char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
@@ -154,7 +154,7 @@ void
 printvalues(FILE *fp, struct mknoiseparams *p)
 {
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   /* Print all the options that are set. Separate each group with a
      commented line explaining the options in that group. */
@@ -192,7 +192,7 @@ void
 checkifset(struct mknoiseparams *p)
 {
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   int intro=0;
   if(cp->hduset==0)
@@ -328,7 +328,7 @@ void
 setparams(int argc, char *argv[], struct mknoiseparams *p)
 {
   char message[GAL_TIMING_VERB_MSG_LENGTH_V];
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   /* Set the non-zero initial values, the structure was initialized to
      have a zero value for all elements. */
diff --git a/src/mkprof/main.h b/src/mkprof/main.h
index fd46e28..03ba228 100644
--- a/src/mkprof/main.h
+++ b/src/mkprof/main.h
@@ -136,7 +136,7 @@ struct mkprofparams
 {
   /* Other structures */
   struct uiparams     up;  /* User interface parameters.               */
-  struct commonparams cp;  /* Common parameters.                       */
+  struct gal_commonparams cp; /* Common parameters.                    */
 
   /* Operating modes */
   int           psfinimg;  /* ==1: Build PSF profiles in image.        */
diff --git a/src/mkprof/oneprofile.c b/src/mkprof/oneprofile.c
index 8712dd7..7d327dd 100644
--- a/src/mkprof/oneprofile.c
+++ b/src/mkprof/oneprofile.c
@@ -224,7 +224,7 @@ void
 makepixbypix(struct mkonthread *mkp)
 {
   float circ_r;
-  struct sll *Q=NULL;
+  struct gal_linkedlist_sll *Q=NULL;
   unsigned char *byt;
   float *img=mkp->ibq->img;
   int use_rand_points=1, ispeak=1;
@@ -235,7 +235,7 @@ makepixbypix(struct mkonthread *mkp)
   double (*profile)(struct mkonthread *)=mkp->profile;
   double xc=mkp->xc, yc=mkp->yc, os=mkp->p->oversample;
   double truncr=mkp->truncr, approx, hp=mkp->p->halfpixel;
-  struct tosll *lQ=NULL, *sQ;  /* lQ: Largest. sQ: Smallest in queue */
+  struct gal_linkedlist_tosll *lQ=NULL, *sQ; /* lQ: Largest. sQ: Smallest in 
queue */
 
   /* Find the nearest pixel to the profile center and add it to the
      queue. */
diff --git a/src/mkprof/ui.c b/src/mkprof/ui.c
index 1638d18..9070afb 100644
--- a/src/mkprof/ui.c
+++ b/src/mkprof/ui.c
@@ -69,7 +69,7 @@ readconfig(char *filename, struct mkprofparams *p)
   char *line, *name, *value;
   struct uiparams *up=&p->up;
   size_t lineno=0, len=200, tmp;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
   char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
@@ -324,7 +324,7 @@ void
 printvalues(FILE *fp, struct mkprofparams *p)
 {
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   fprintf(fp, "\n# Input:\n");
   if(cp->hduset)
@@ -720,7 +720,7 @@ setparams(int argc, char *argv[], struct mkprofparams *p)
   char *jobname;
   struct timeval t1;
   char message[GAL_TIMING_VERB_MSG_LENGTH_V];
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   /* Set the non-zero initial values, the structure was initialized to
      have a zero value for all elements. */
diff --git a/src/noisechisel/clumps.c b/src/noisechisel/clumps.c
index 23dad1e..f751962 100644
--- a/src/noisechisel/clumps.c
+++ b/src/noisechisel/clumps.c
@@ -84,7 +84,7 @@ oversegment(struct clumpsthreadparams *ctp)
   size_t pix;
 
   float *arr=p->conv;
-  struct sll *Q=NULL, *cleanup=NULL;
+  struct gal_linkedlist_sll *Q=NULL, *cleanup=NULL;
   long n1, rlab, nlab, curlab=1, *clab=p->clab;
   size_t x0=ctp->x0, y0=ctp->y0, x1=ctp->x1, y1=ctp->y1;
   size_t *n, *nf, *indf, *pind, *ind=&pix, is1=p->lmp.s1;
@@ -488,7 +488,7 @@ void
 getclumpinfo(struct clumpsthreadparams *ctp, double **outclumpinfo)
 {
   struct noisechiselparams *p=ctp->p;
-  struct meshparams *smp=&p->smp;
+  struct gal_mesh_params *smp=&p->smp;
 
   double *xys, *clumpinfo;
   float *img=p->img, *smpstd=smp->garray2;
@@ -772,8 +772,8 @@ void *
 clumpsntableonmesh(void *inparams)
 {
   struct clumpsthreadparams ctp;
-  struct meshthreadparams *mtp=(struct meshthreadparams *)inparams;
-  struct meshparams *mp=mtp->mp;
+  struct gal_mesh_thread_params *mtp=(struct gal_mesh_thread_params *)inparams;
+  struct gal_mesh_params *mp=mtp->mp;
   struct noisechiselparams *p=(struct noisechiselparams *)mp->params;
 
   size_t *mponeforall=mp->oneforall;
@@ -868,13 +868,13 @@ void
 findclumpsn(struct noisechiselparams *p)
 {
   float *sntable;
-  struct meshparams *lmp=&p->lmp;
+  struct gal_mesh_params *lmp=&p->lmp;
   size_t i, j, numclumps=0, nmeshi=lmp->nmeshi;
 
 
   /* Set the convolved image as the basis for sorting the indexs and
      finding clumps. */
-  forqsortindexarr=p->conv;
+  gal_qsort_index_arr=p->conv;
 
 
   /* Allocate the two arrays to keep the number and values of the S/Ns
@@ -950,7 +950,7 @@ findclumpsn(struct noisechiselparams *p)
 void
 removefalseclumps(struct clumpsthreadparams *ctp, float *sntable)
 {
-  struct meshparams *lmp=&ctp->p->lmp;
+  struct gal_mesh_params *lmp=&ctp->p->lmp;
 
   long *newlabs, *clab=ctp->p->clab;
   size_t *n, *nf, is0=lmp->s0, is1=lmp->s1;
diff --git a/src/noisechisel/detection.c b/src/noisechisel/detection.c
index 1f2ac2b..336b3e8 100644
--- a/src/noisechisel/detection.c
+++ b/src/noisechisel/detection.c
@@ -161,7 +161,7 @@ void
 detlabelsn(struct noisechiselparams *p, size_t *numlabs, float **outsntable)
 {
   float *imgss=p->imgss;
-  struct meshparams *smp=&p->smp;
+  struct gal_mesh_params *smp=&p->smp;
   double *brightnesses, err, *xys;
   float *f, *ff, ave, *sntable, cpscorr=p->cpscorr;
   size_t i, ind, xyscol=3, is1=p->smp.s1, counter=0;
@@ -418,8 +418,8 @@ bytparttolarge(struct noisechiselparams *p, unsigned char 
*in,
 void*
 detectpseudos(void *inparams)
 {
-  struct meshthreadparams *mtp=(struct meshthreadparams *)inparams;
-  struct meshparams *mp=mtp->mp;
+  struct gal_mesh_thread_params *mtp=(struct gal_mesh_thread_params *)inparams;
+  struct gal_mesh_params *mp=mtp->mp;
   struct noisechiselparams *p=(struct noisechiselparams *)mp->params;
 
   unsigned char *mponeforall=mp->oneforall;
@@ -503,7 +503,7 @@ detectpseudos(void *inparams)
 void
 detsnthresh(struct noisechiselparams *p)
 {
-  struct meshparams *lmp=&p->lmp;
+  struct gal_mesh_params *lmp=&p->lmp;
 
   float *sntable;
   static int b0f1;
@@ -695,7 +695,7 @@ dbytolaboverlap(struct noisechiselparams *p)
 void
 onlytruedetections(struct noisechiselparams *p)
 {
-  struct meshparams *lmp=&p->lmp;
+  struct gal_mesh_params *lmp=&p->lmp;
 
   int verb=p->cp.verb;
   char report[GAL_TIMING_VERB_MSG_LENGTHS_2_V];
diff --git a/src/noisechisel/label.c b/src/noisechisel/label.c
index b3bd6f5..1d3a809 100644
--- a/src/noisechisel/label.c
+++ b/src/noisechisel/label.c
@@ -59,7 +59,7 @@ size_t
 BF_concmp(unsigned char *byt, long *lab, size_t s0, size_t s1,
           int anyblank, const size_t connectivity)
 {
-  struct sll *Q=NULL;
+  struct gal_linkedlist_sll *Q=NULL;
   long *l=lab, curlab=1; /* Current label */
   size_t i, p, size=s0*s1, s0t1=s0-1, s1t1=s1-1;
   unsigned char *b=byt, *bf=byt+s0*s1, counter, bl, br, tl, tr;
@@ -196,7 +196,7 @@ size_t
 BF_concomp_AdjMatrix(int *adj, size_t numside, long **outnewlabs)
 {
   size_t i, j, p;
-  struct sll *Q=NULL;
+  struct gal_linkedlist_sll *Q=NULL;
   long *newlabs, curlab=1;
 
   errno=0;
diff --git a/src/noisechisel/main.h b/src/noisechisel/main.h
index 3c7f9cc..6dd2dd1 100644
--- a/src/noisechisel/main.h
+++ b/src/noisechisel/main.h
@@ -95,10 +95,10 @@ struct uiparams
 struct noisechiselparams
 {
   /* Other structures: */
-  struct uiparams       up; /* User interface parameters.                  */
-  struct commonparams   cp; /* Common parameters.                          */
-  struct meshparams    smp; /* Smaller mesh grid of input image.           */
-  struct meshparams    lmp; /* Larger mesh grid of input image.            */
+  struct uiparams         up; /* User interface parameters.                */
+  struct gal_commonparams cp; /* Common parameters.                        */
+  struct gal_mesh_params smp; /* Smaller mesh grid of input image.         */
+  struct gal_mesh_params lmp; /* Larger mesh grid of input image.          */
 
   /* Input: */
   int                 nwcs; /* Number of WCS structures.                   */
diff --git a/src/noisechisel/noisechisel.c b/src/noisechisel/noisechisel.c
index d821f19..e2b29a7 100644
--- a/src/noisechisel/noisechisel.c
+++ b/src/noisechisel/noisechisel.c
@@ -62,7 +62,7 @@ makeoutput(struct noisechiselparams *p)
   double *dpt;
   long num[0];
   float *sky=NULL, *std=NULL;
-  struct fitsheaderll *keys=NULL;
+  struct gal_fitsarray_header_ll *keys=NULL;
   size_t s0=p->smp.s0, s1=p->smp.s1;
 
 
@@ -149,7 +149,7 @@ makeoutput(struct noisechiselparams *p)
 void
 noisechisel(struct noisechiselparams *p)
 {
-  struct meshparams *smp=&p->smp, *lmp=&p->lmp;
+  struct gal_mesh_params *smp=&p->smp, *lmp=&p->lmp;
 
   float *imgcopy;
   struct timeval t1;
diff --git a/src/noisechisel/segmentation.c b/src/noisechisel/segmentation.c
index 1aaedb7..2b40f88 100644
--- a/src/noisechisel/segmentation.c
+++ b/src/noisechisel/segmentation.c
@@ -59,7 +59,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 void
 prepfirstgrowth(struct clumpsthreadparams *ctp)
 {
-  struct meshparams *smp=&ctp->p->smp;
+  struct gal_mesh_params *smp=&ctp->p->smp;
 
   size_t *ind, *indf, is1=smp->s1;
   float growlimit, *imgss=ctp->p->imgss;
diff --git a/src/noisechisel/sky.c b/src/noisechisel/sky.c
index 138ee56..0437f14 100644
--- a/src/noisechisel/sky.c
+++ b/src/noisechisel/sky.c
@@ -38,8 +38,8 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 void *
 avestdonthread(void *inparam)
 {
-  struct meshthreadparams *mtp=(struct meshthreadparams *)inparam;
-  struct meshparams *mp=mtp->mp;
+  struct gal_mesh_thread_params *mtp=(struct gal_mesh_thread_params *)inparam;
+  struct gal_mesh_params *mp=mtp->mp;
   struct noisechiselparams *p=(struct noisechiselparams *)mp->params;
 
   float *mponeforall=mp->oneforall;
@@ -123,7 +123,7 @@ avestdonthread(void *inparam)
 void
 findavestdongrid(struct noisechiselparams *p, char *outname)
 {
-  struct meshparams *smp=&p->smp;
+  struct gal_mesh_params *smp=&p->smp;
   size_t s0=smp->s0, s1=smp->s1;
 
 
@@ -184,7 +184,7 @@ findavestdongrid(struct noisechiselparams *p, char *outname)
 void
 findsubtractskyconv(struct noisechiselparams *p)
 {
-  struct meshparams *smp=&p->smp;
+  struct gal_mesh_params *smp=&p->smp;
 
   float *f, *fp, *tmpg1, *tmpg2, *tmpimg;
   size_t gid, s0, s1, row, start, chbasedid, is1=smp->s1;
@@ -245,7 +245,7 @@ findsubtractskyconv(struct noisechiselparams *p)
 void
 subtractskyimg(struct noisechiselparams *p)
 {
-  struct meshparams *smp=&p->smp;
+  struct gal_mesh_params *smp=&p->smp;
 
   float *f, *fp, *in, sky;
   size_t gid, s0, s1, row, start, chbasedid, is1=smp->s1;
diff --git a/src/noisechisel/thresh.c b/src/noisechisel/thresh.c
index 3bfb2ec..f00b6f3 100644
--- a/src/noisechisel/thresh.c
+++ b/src/noisechisel/thresh.c
@@ -52,8 +52,8 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 void *
 qthreshonmesh(void *inparam)
 {
-  struct meshthreadparams *mtp=(struct meshthreadparams *)inparam;
-  struct meshparams *mp=mtp->mp;
+  struct gal_mesh_thread_params *mtp=(struct gal_mesh_thread_params *)inparam;
+  struct gal_mesh_params *mp=mtp->mp;
   struct noisechiselparams *p=(struct noisechiselparams *)mp->params;
 
   float *mponeforall=mp->oneforall;
@@ -118,7 +118,7 @@ qthreshonmesh(void *inparam)
 
 
 /* The threshold values are stored in the garray1 array of the
-   meshparams structure. This function is basically identical to the
+   gal_mesh_params structure. This function is basically identical to the
    gal_mesh_check_garray function in mesh.c, only in the middle, it does
    something else.
 
@@ -127,8 +127,8 @@ qthreshonmesh(void *inparam)
 void
 applythreshold(struct noisechiselparams *p)
 {
-  struct meshparams *mp=&p->smp; /* `mp' instead of `smp' so you can try */
-                                 /* with p->lmp if you like.             */
+  struct gal_mesh_params *mp=&p->smp; /* `mp' instead of `smp' so you can try 
*/
+                                      /* with p->lmp if you like.             
*/
   unsigned char *b, *byt=p->byt;
   size_t gs0=mp->gs0, gs1=mp->gs1, nch1=mp->nch1;
   size_t s0, s1, fs1=mp->gs1*mp->nch1, chid, inchid;
@@ -175,7 +175,7 @@ applythreshold(struct noisechiselparams *p)
 void
 findapplyqthreshold(struct noisechiselparams *p)
 {
-  struct meshparams *mp=&p->smp;
+  struct gal_mesh_params *mp=&p->smp;
 
   /* Find the threshold on each mesh: */
   gal_mesh_operate_on_mesh(mp, qthreshonmesh, sizeof(float), 0, 1);
@@ -221,11 +221,11 @@ findapplyqthreshold(struct noisechiselparams *p)
 /*********************************************************************/
 /* This is very similar to the gal_mesh_check_garray function. The sky and its
    Standard deviation are stored in the garray1 and garray2 arrays of
-   smp meshparams structure. */
+   smp gal_mesh_params structure. */
 void
 applydetectionthresholdskysub(struct noisechiselparams *p)
 {
-  struct meshparams *smp=&p->smp;
+  struct gal_mesh_params *smp=&p->smp;
 
   size_t is0=smp->s0;
   float *f, *in, sky, std;
diff --git a/src/noisechisel/ui.c b/src/noisechisel/ui.c
index c1432eb..b662082 100644
--- a/src/noisechisel/ui.c
+++ b/src/noisechisel/ui.c
@@ -71,7 +71,7 @@ readconfig(char *filename, struct noisechiselparams *p)
   size_t lineno=0, len=200;
   char *line, *name, *value;
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
   char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
@@ -441,8 +441,8 @@ void
 printvalues(FILE *fp, struct noisechiselparams *p)
 {
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
-  struct meshparams *smp=&p->smp, *lmp=&p->lmp;
+  struct gal_commonparams *cp=&p->cp;
+  struct gal_mesh_params *smp=&p->smp, *lmp=&p->lmp;
 
   /* Print all the options that are set. Separate each group with a
      commented line explaining the options in that group. */
@@ -589,7 +589,7 @@ void
 checkifset(struct noisechiselparams *p)
 {
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   int intro=0;
   if(cp->hduset==0)
@@ -703,7 +703,7 @@ checkifset(struct noisechiselparams *p)
 void
 sanitycheck(struct noisechiselparams *p)
 {
-  struct meshparams *smp=&p->smp;
+  struct gal_mesh_params *smp=&p->smp;
 
   /* Set the maskname and mask hdu accordingly: */
   gal_fitsarray_file_or_ext_name(p->up.inputname, p->cp.hdu, p->up.masknameset,
@@ -878,7 +878,7 @@ float defaultkernel[121]=
 void
 preparearrays(struct noisechiselparams *p)
 {
-  struct meshparams *smp=&p->smp, *lmp=&p->lmp;
+  struct gal_mesh_params *smp=&p->smp, *lmp=&p->lmp;
 
   long *meshindexs;
   float *f, *ff, *fp;
@@ -1037,7 +1037,7 @@ preparearrays(struct noisechiselparams *p)
 void
 setparams(int argc, char *argv[], struct noisechiselparams *p)
 {
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   /* Set the non-zero initial values, the structure was initialized to
      have a zero value for all elements. */
diff --git a/src/subtractsky/main.h b/src/subtractsky/main.h
index 43aebd4..c130a8d 100644
--- a/src/subtractsky/main.h
+++ b/src/subtractsky/main.h
@@ -71,8 +71,8 @@ struct subtractskyparams
 {
   /* Other structures: */
   struct uiparams     up;  /* User interface parameters.                 */
-  struct commonparams cp;  /* Common parameters.                         */
-  struct meshparams   mp;  /* Mesh grid of input image.                  */
+  struct gal_commonparams cp; /* Common parameters.                      */
+  struct gal_mesh_params mp; /* Mesh grid of input image.                */
 
   /* Input: */
   int               nwcs;  /* Number of WCS structures.                  */
diff --git a/src/subtractsky/subtractsky.c b/src/subtractsky/subtractsky.c
index 6645198..3c974d3 100644
--- a/src/subtractsky/subtractsky.c
+++ b/src/subtractsky/subtractsky.c
@@ -41,8 +41,8 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 void *
 avestdonthread(void *inparam)
 {
-  struct meshthreadparams *mtp=(struct meshthreadparams *)inparam;
-  struct meshparams *mp=mtp->mp;
+  struct gal_mesh_thread_params *mtp=(struct gal_mesh_thread_params *)inparam;
+  struct gal_mesh_params *mp=mtp->mp;
   struct subtractskyparams *p=(struct subtractskyparams *)mp->params;
 
   float *mponeforall=mp->oneforall;
@@ -144,7 +144,7 @@ avestdonthread(void *inparam)
 void
 subtractsky(struct subtractskyparams *p)
 {
-  struct meshparams *mp=&p->mp;
+  struct gal_mesh_params *mp=&p->mp;
 
   long *meshindexs;
   struct timeval t1;
diff --git a/src/subtractsky/ui.c b/src/subtractsky/ui.c
index 484c9fe..2914b58 100644
--- a/src/subtractsky/ui.c
+++ b/src/subtractsky/ui.c
@@ -71,7 +71,7 @@ readconfig(char *filename, struct subtractskyparams *p)
   size_t lineno=0, len=200;
   char *line, *name, *value;
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
   char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
@@ -284,8 +284,8 @@ void
 printvalues(FILE *fp, struct subtractskyparams *p)
 {
   struct uiparams *up=&p->up;
-  struct meshparams *mp=&p->mp;
-  struct commonparams *cp=&p->cp;
+  struct gal_mesh_params *mp=&p->mp;
+  struct gal_commonparams *cp=&p->cp;
 
   /* Print all the options that are set. Separate each group with a
      commented line explaining the options in that group. */
@@ -384,7 +384,7 @@ void
 checkifset(struct subtractskyparams *p)
 {
   struct uiparams *up=&p->up;
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   int intro=0;
   if(cp->hduset==0)
@@ -495,7 +495,7 @@ sanitycheck(struct subtractskyparams *p)
           "(`-n') is %d. You have asked for: %lu.",
           GAL_MESH_MIN_ACCEPTABLE_NEAREST, p->mp.numnearest);
 
-  /* Set the constants in the meshparams structure. */
+  /* Set the constants in the gal_mesh_params structure. */
   p->mp.params=p;
   p->mp.numthreads=p->cp.numthreads;
 }
@@ -524,7 +524,7 @@ sanitycheck(struct subtractskyparams *p)
 void
 preparearrays(struct subtractskyparams *p)
 {
-  struct meshparams *mp=&p->mp;
+  struct gal_mesh_params *mp=&p->mp;
 
   /* Read the input image. */
   gal_fitsarray_file_to_float(p->up.inputname, p->up.maskname, p->cp.hdu,
@@ -570,7 +570,7 @@ preparearrays(struct subtractskyparams *p)
 void
 setparams(int argc, char *argv[], struct subtractskyparams *p)
 {
-  struct commonparams *cp=&p->cp;
+  struct gal_commonparams *cp=&p->cp;
 
   /* Set the non-zero initial values, the structure was initialized to
      have a zero value for all elements. */



reply via email to

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