gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 13a426f: Renamed lib/gnuastro.h to lib/config.


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 13a426f: Renamed lib/gnuastro.h to lib/config.h
Date: Sat, 19 Nov 2016 22:54:12 +0000 (UTC)

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

    Renamed lib/gnuastro.h to lib/config.h
    
    The header file containing the Gnuastro installation configurations was
    called with `gnuastro/gnuastro.h', or its macros were called
    `GAL_GNUASTRO_*', this isn't too clear and could be confusing. Since
    practically the contents of this header are the same as those in `config.h'
    when building Gnuastro, the header name was changed to
    `gnuastro/config.h'. The name is clear and unambiguous both when including
    and also when calling the macros (or possibly functions later).
---
 .gitignore                         |    4 ++--
 configure.ac                       |    8 ++++----
 doc/gnuastro.texi                  |   30 +++++++++++++++---------------
 lib/Makefile.am                    |   12 ++++++------
 lib/{gnuastro.h.in => config.h.in} |   15 +++++++--------
 lib/git.c                          |    2 +-
 lib/gnuastro/git.h                 |    2 +-
 lib/gnuastro/threads.h             |   12 ++++++------
 lib/threads.c                      |    4 ++--
 tests/Makefile.am                  |    2 +-
 tests/lib/arraymanip.c             |    4 ++--
 tests/lib/versioncpp.cpp           |    4 ++--
 12 files changed, 49 insertions(+), 50 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4fe17ec..4906355 100644
--- a/.gitignore
+++ b/.gitignore
@@ -92,6 +92,7 @@ astconvertt
 astconvolve
 test-driver
 config.h.in
+lib/config.h
 astcosmiccal
 astmkcatalog
 gnuastro.t2p
@@ -105,11 +106,10 @@ astarithmetic
 astnoisechisel
 astsubtractsky
 autom4te.cache
-lib/gnuastro.h
 lib/gnuastro.pc
 doc/gnuastro.cps
 doc/gnuastro.vrs
-lib/gnuastro/gnuastro.h
+lib/gnuastro/config.h
 
 
 
diff --git a/configure.ac b/configure.ac
index 96b884d..9b6416d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,8 +83,8 @@ LT_INIT
 # build system, not on the user's system. While we are building Gnuastro,
 # we have the important installation information in `config.h'. But in the
 # user's own programs, this information is defined in
-# `gnuastro/gnuastro.h'. With this macro, the installed headers can decide
-# if the latter should be included or not. Note that `gnuastro/gnuastro.h'
+# `gnuastro/config.h'. With this macro, the installed headers can decide
+# if the latter should be included or not. Note that `gnuastro/config.h'
 # is only built at installation time and doesn't exist when building
 # Gnuastro. Therefore, this macro must not be defined in a user's program.
 AC_DEFINE([IN_GNUASTRO_BUILD], [1], [In building, not usage])
@@ -157,7 +157,7 @@ AC_CHECK_LIB([wcs], [wcslib_version],
              [], [-lcfitsio -lm])
 AC_CHECK_LIB([pthread], [pthread_barrier_wait], [has_pthread_barrier=1],
              [has_pthread_barrier=0])
-AC_DEFINE_UNQUOTED([GAL_GNUASTRO_HAVE_PTHREAD_BARRIER], [$has_pthread_barrier],
+AC_DEFINE_UNQUOTED([GAL_CONFIG_HAVE_PTHREAD_BARRIER], [$has_pthread_barrier],
                    [System has pthread_barrier])
 AC_SUBST(HAVE_PTHREAD_BARRIER, [$has_pthread_barrier])
 
@@ -199,7 +199,7 @@ AM_CONDITIONAL([COND_HASLIBJPEG], [test "x$has_libjpeg" = 
"xyes"])
 # Check libgit2:
 AC_SEARCH_LIBS([git_libgit2_init], [git2],
                [has_libgit2=1], [has_libgit2=0])
-AC_DEFINE_UNQUOTED([GAL_GNUASTRO_HAVE_LIBGIT2], [$has_libgit2],
+AC_DEFINE_UNQUOTED([GAL_CONFIG_HAVE_LIBGIT2], [$has_libgit2],
                    [libgit2 is installed on the system])
 AS_IF([test "x$has_libgit2" = "x1"], [], [anywarnings=yes])
 AC_SUBST(HAVE_LIBGIT2, [$has_libgit2])
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 6900b8c..28b6d2b 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -508,7 +508,7 @@ Review of library fundamentals
 
 Gnuastro library
 
-* Installation information::    General information about the installation.
+* Configuration information::   General information about library config.
 * Array manipulation::          Functions for manipulating arrays.
 * Bounding box::                Finding the bounding box.
 * FITS files::                  Working with FITS data.
@@ -15128,7 +15128,7 @@ problems. It will stabilize with the removal of this 
notice. Check the
 @end cartouche
 
 @menu
-* Installation information::    General information about the installation.
+* Configuration information::   General information about library config.
 * Array manipulation::          Functions for manipulating arrays.
 * Bounding box::                Finding the bounding box.
 * FITS files::                  Working with FITS data.
@@ -15144,10 +15144,10 @@ problems. It will stabilize with the removal of this 
notice. Check the
 * World Coordinate System::     Dealing with the world coordinate system.
 @end menu
 
address@hidden Installation information, Array manipulation, Gnuastro library, 
Gnuastro library
address@hidden Installation information (@file{gnuastro.h})
address@hidden Configuration information, Array manipulation, Gnuastro library, 
Gnuastro library
address@hidden Configuration information (@file{config.h})
 
-The @file{gnuastro/gnuastro.h} header contains information about the full
+The @file{gnuastro/config.h} header contains information about the full
 Gnuastro installation on your system. Gnuastro developers should note that
 this is the only header that is not available within Gnuastro, it is only
 available to a Gnuastro library user @emph{after} installation. Within
@@ -15155,26 +15155,26 @@ Gnuastro, @file{config.h} (which is included in every 
Gnuastro @file{.c}
 file, see @ref{Coding conventions}) should have more than enough
 information about the overall Gnuastro installation.
 
address@hidden Macro GAL_GNUASTRO_VERSION
address@hidden Macro GAL_CONFIG_VERSION
 This macro can be used as a string
 address@hidden@url{https://en.wikipedia.org/wiki/String_literal}}
 containing the version of Gnuastro that is being used. See @ref{Version
 numbering} for the version formats. For example:
 
 @example
-printf("Gnuastro version: %s\n", GAL_GNUASTRO_VERSION);
+printf("Gnuastro version: %s\n", GAL_CONFIG_VERSION);
 @end example
 
 @noindent
 or
 
 @example
-char *gnuastro_version=GAL_GNUASTRO_VERSION;
+char *gnuastro_version=GAL_CONFIG_VERSION;
 @end example
 @end deffn
 
 
address@hidden Macro GAL_GNUASTRO_HAVE_LIBGIT2
address@hidden Macro GAL_CONFIG_HAVE_LIBGIT2
 Libgit2 is an optional dependency of Gnuastro (see @ref{Optional
 dependencies}). When it is installed and detected at configure time, this
 macro will have a value of @code{1}. Otherwise, it will have a value of
@@ -15183,7 +15183,7 @@ libgit2 (see @ref{Git wrappers}).
 @end deffn
 
 
address@hidden Macro GAL_GNUASTRO_HAVE_PTHREAD_BARRIER
address@hidden Macro GAL_CONFIG_HAVE_PTHREAD_BARRIER
 The POSIX threads standard define barriers as an optional
 requirement. Therefore, some operating systems choose to not include
 it. While installing Gnuastro, we check if your system has this construct
@@ -15192,7 +15192,7 @@ value of @code{0}. see @ref{Implementation of 
pthread_barrier} for more.
 @end deffn
 
 
address@hidden Array manipulation, Bounding box, Installation information, 
Gnuastro library
address@hidden Array manipulation, Bounding box, Configuration information, 
Gnuastro library
 @subsection Array manipulation (@file{array.h})
 
 When working on arrays, certain operations are commonly necessary. It is
@@ -15898,13 +15898,13 @@ error notice.
 
 @cindex Git
 @cindex libgit2
-Git is one of the most common tools for version control and it can often
-be useful during development, for example see @code{COMMIT} keyword in
+Git is one of the most common tools for version control and it can often be
+useful during development, for example see @code{COMMIT} keyword in
 @ref{Output headers}. The functions introduced here are described in the
 @file{gnuastro/git.h} header. At installation time, Gnuastro will also
 check for the existence of libgit2 and store the value in the
address@hidden, see @ref{Installation
-information}. @file{gnuastro/git.h} includes @file{gnuastro/gnuastro.h}
address@hidden, see @ref{Configuration
+information}. @file{gnuastro/git.h} includes @file{gnuastro/config.h}
 internally, so won't have to include both for this macro.
 
 @deftypefun {char *} gal_git_describe ( )
diff --git a/lib/Makefile.am b/lib/Makefile.am
index cfe48c7..24e52d8 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -39,7 +39,7 @@ libgnuastro_la_SOURCES = array.c box.c checkset.c 
configfiles.c fits.c  \
 # Installed headers, note that we are not blindly including all `.h' files
 # in the $(headersdir) directory. Some of the header files don't need to be
 # installed.
-pkginclude_HEADERS = gnuastro/gnuastro.h $(headersdir)/array.h            \
+pkginclude_HEADERS = gnuastro/config.h $(headersdir)/array.h              \
   $(headersdir)/box.h $(headersdir)/fits.h $(headersdir)/git.h            \
   $(headersdir)/linkedlist.h $(headersdir)/mesh.h $(headersdir)/polygon.h \
   $(headersdir)/qsort.h $(headersdir)/spatialconvolve.h                   \
@@ -53,7 +53,7 @@ pkginclude_HEADERS = gnuastro/gnuastro.h 
$(headersdir)/array.h            \
 # will not distributed, so we need to explicitly tell Automake to
 # distribute them here.
 headersdir=$(top_srcdir)/lib/gnuastro
-EXTRA_DIST = gnuastro.pc.in gnuastro.h.in checkset.h commonargs.h       \
+EXTRA_DIST = gnuastro.pc.in config.h.in checkset.h commonargs.h         \
   commonparams.h configfiles.h fixedstringmacros.h mode.h neighbors.h   \
   timing.h $(headersdir)/README
 
@@ -62,18 +62,18 @@ EXTRA_DIST = gnuastro.pc.in gnuastro.h.in checkset.h 
commonargs.h       \
 # Makefile.am)
 pkgconfig_DATA = gnuastro.pc
 pkgconfigdir = $(libdir)/pkgconfig
-CLEANFILES = gnuastro.pc gnuastro/gnuastro.h
+CLEANFILES = gnuastro.pc gnuastro/config.h
 
 
-# Build Gnuastro's pkg-config file and `gnuastro.h' based on the
+# Build Gnuastro's pkg-config file and `config.h' based on the
 # information in the Makefile after the Makefile has been built.
-gnuastro/gnuastro.h: Makefile gnuastro.h.in
+gnuastro/config.h: Makefile config.h.in
        rm -f $@ address@hidden
        $(MKDIR_P) gnuastro
        $(SED) -e 's|@address@hidden|$(VERSION)|g'                            \
               -e 's|@address@hidden|$(HAVE_LIBGIT2)|g'                  \
               -e 's|@address@hidden|$(HAVE_PTHREAD_BARRIER)|g'  \
-               $(srcdir)/gnuastro.h.in >> address@hidden
+               $(srcdir)/config.h.in >> address@hidden
        chmod a-w address@hidden
        mv address@hidden $@
 
diff --git a/lib/gnuastro.h.in b/lib/config.h.in
similarity index 80%
rename from lib/gnuastro.h.in
rename to lib/config.h.in
index c7c6e31..f378244 100644
--- a/lib/gnuastro.h.in
+++ b/lib/config.h.in
@@ -19,19 +19,18 @@ General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
 **********************************************************************/
-#ifndef __GAL_GNUASTRO_H__
-#define __GAL_GNUASTRO_H__
+#ifndef __GAL_CONFIG_H__
+#define __GAL_CONFIG_H__
 
 /* Include other headers if necessary here. Note that other header files
    must be included before the C++ preparations below */
 
 
 
-/* Macros. In gnuastro.h.in, the values in `@' --- `@'', will be replaced
-   with installation specific values. */
-#define GAL_GNUASTRO_VERSION "@VERSION@"
-#define GAL_GNUASTRO_HAVE_LIBGIT2 @HAVE_LIBGIT2@
-#define GAL_GNUASTRO_HAVE_PTHREAD_BARRIER @HAVE_PTHREAD_BARRIER@
+/* Macros. */
+#define GAL_CONFIG_VERSION "@VERSION@"
+#define GAL_CONFIG_HAVE_LIBGIT2 @HAVE_LIBGIT2@
+#define GAL_CONFIG_HAVE_PTHREAD_BARRIER @HAVE_PTHREAD_BARRIER@
 
 
 
@@ -59,4 +58,4 @@ __BEGIN_C_DECLS  /* From C++ preparations */
 
 __END_C_DECLS    /* From C++ preparations */
 
-#endif           /* __GAL_GNUASTRO_H__ */
+#endif           /* __GAL_CONFIG_H__ */
diff --git a/lib/git.c b/lib/git.c
index 92064f4..b6cdff4 100644
--- a/lib/git.c
+++ b/lib/git.c
@@ -36,7 +36,7 @@ gal_git_describe(void)
   char *describe_return=NULL;
 
 /* Only actually work on Git if the library is present. */
-#if GAL_GNUASTRO_HAVE_LIBGIT2 == 1
+#if GAL_CONFIG_HAVE_LIBGIT2 == 1
   git_buf buf={0};
   git_repository *repo;
   git_describe_result *describe_result;
diff --git a/lib/gnuastro/git.h b/lib/gnuastro/git.h
index 9650701..84651bf 100644
--- a/lib/gnuastro/git.h
+++ b/lib/gnuastro/git.h
@@ -24,7 +24,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #define __GAL_GIT_H__
 
 
-#if GAL_GNUASTRO_HAVE_LIBGIT2 == 1
+#if GAL_CONFIG_HAVE_LIBGIT2 == 1
 #include <git2.h>
 #endif
 
diff --git a/lib/gnuastro/threads.h b/lib/gnuastro/threads.h
index 42e8bb8..1e8a15b 100644
--- a/lib/gnuastro/threads.h
+++ b/lib/gnuastro/threads.h
@@ -29,14 +29,14 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 /* When this header is included within Gnuastro's building process,
    `IN_GNUASTRO_BUILD' is defined. In the build process, installation
-   information (in particular `GAL_GNUASTRO_HAVE_PTHREAD_BARRIER' that we
+   information (in particular `GAL_CONFIG_HAVE_PTHREAD_BARRIER' that we
    need below) is kept in `config.h'. When building a user's programs, this
-   information is kept in `gnuastro/gnuastro.h'. Note that all `.c' files
+   information is kept in `gnuastro/config.h'. Note that all `.c' files
    must start with the inclusion of `config.h' and that
-   `gnuastro/gnuastro.h' is only created at installation time (not present
+   `gnuastro/config.h' is only created at installation time (not present
    during the building of Gnuastro).*/
 #ifndef IN_GNUASTRO_BUILD
-#include <gnuastro/gnuastro.h>
+#include <gnuastro/config.h>
 #endif
 
 /* C++ Preparations */
@@ -66,7 +66,7 @@ __BEGIN_C_DECLS  /* From C++ preparations */
 /*****************************************************************/
 /*********    Implementation of pthread_barrier    ***************/
 /*****************************************************************/
-#if GAL_GNUASTRO_HAVE_PTHREAD_BARRIER == 0
+#if GAL_CONFIG_HAVE_PTHREAD_BARRIER == 0
 
 /* Integer number of nano-seconds that `pthread_barrier_destroy' should
    wait for a check to see if all barriers have been reached. */
@@ -93,7 +93,7 @@ pthread_barrier_wait(pthread_barrier_t *b);
 int
 pthread_barrier_destroy(pthread_barrier_t *b);
 
-#endif  /* GAL_GNUASTRO_HAVE_PTHREAD_BARRIER == 0 */
+#endif  /* GAL_CONFIG_HAVE_PTHREAD_BARRIER == 0 */
 
 
 
diff --git a/lib/threads.c b/lib/threads.c
index b812865..96a55d0 100644
--- a/lib/threads.c
+++ b/lib/threads.c
@@ -42,7 +42,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 /* Re-implementation of the example code given in:
 http://blog.albertarmea.com/post/47089939939/using-pthread-barrier-on-mac-os-x
  */
-#if GAL_GNUASTRO_HAVE_PTHREAD_BARRIER == 0
+#if GAL_CONFIG_HAVE_PTHREAD_BARRIER == 0
 
 /* Initialize the barrier structure. A barrier is a high-level way to wait
    until several threads have finished. */
@@ -144,7 +144,7 @@ pthread_barrier_destroy(pthread_barrier_t *b)
   return 0;
 }
 
-#endif  /* GAL_GNUASTRO_HAVE_PTHREAD_BARRIER == 0 */
+#endif  /* GAL_CONFIG_HAVE_PTHREAD_BARRIER == 0 */
 
 
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2657dbe..162eafe 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -35,7 +35,7 @@ endif
 
 
 
-# `gnuastro.h' is built by `../lib/Makefile.am' and is only meant for
+# `config.h' is built by `../lib/Makefile.am' and is only meant for
 # outside users (internally `config.h' has everything. Thus, we need to add
 # it to the include directories of the test programs in this directory.
 AM_CPPFLAGS = -I../lib
diff --git a/tests/lib/arraymanip.c b/tests/lib/arraymanip.c
index 8f0d557..114e3f4 100644
--- a/tests/lib/arraymanip.c
+++ b/tests/lib/arraymanip.c
@@ -23,7 +23,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <stdlib.h>
 
 #include "gnuastro/array.h"
-#include "gnuastro/gnuastro.h"
+#include "gnuastro/config.h"
 
 int
 main(void)
@@ -40,7 +40,7 @@ main(void)
     }
 
   /* Print the version of Gnuastro being used: */
-  printf("Test of Gnuastro %s\n", GAL_GNUASTRO_VERSION);
+  printf("Test of Gnuastro %s\n", GAL_CONFIG_VERSION);
 
   /* Fill in the test array and report its contents at the same time. */
   printf("Input array: ");
diff --git a/tests/lib/versioncpp.cpp b/tests/lib/versioncpp.cpp
index b82ce12..d3cc313 100644
--- a/tests/lib/versioncpp.cpp
+++ b/tests/lib/versioncpp.cpp
@@ -23,11 +23,11 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <cstdlib>
 #include <iostream>
 
-#include <gnuastro/gnuastro.h>
+#include <gnuastro/config.h>
 
 int
 main(void)
 {
-  std::cout << "Gnuastro version is: " << GAL_GNUASTRO_VERSION << ".\n";
+  std::cout << "Gnuastro version is: " << GAL_CONFIG_VERSION << ".\n";
   return EXIT_SUCCESS;
 }



reply via email to

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