[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 2cd1e60a231636ae058ac1ab9cb8e05291654e5e
Author: Mosè Giordano <address@hidden>
Date: Thu Nov 5 15:31:37 2015 +0100
Describe in the manual the new naming convention
Addresses task#13765. As discussed in the task, we adopted GSL naming
conventions and agreed to use the "gal" namespace to identify exported
header files, functions, variables and macros. We will use snake_case
for functions, variables, and macros names, as suggested by the GNU
coding standards.
---
doc/gnuastro.texi | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 4567943..b37708f 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -12286,6 +12286,37 @@ very important for easily understanding the code.
@end itemize
+Regarding naming of exported header files, functions, variables, macros,
+and installed libraries, we adopted similar conventions to those used by
+the GSL
address@hidden@url{https://www.gnu.org/software/gsl/design/gsl-design.html#SEC15}}.
+In particular, in order to avoid clashes with the names of functions and
+variables coming from other libraries we decided to use the namespace
address@hidden, which stands for @emph{G}NU @emph{A}stronomy @emph{L}ibrary.
address@hidden
address@hidden
+All exported header files should have a filename with the prefix @code{gal_}.
+
address@hidden
+All function names, variables, etc should be in lower case. Macros and
+preprocessor variables should be in upper case.
+
address@hidden
address@hidden GNU coding standards
+For all exported functions and variables use as prefix the base name of
+the file in which they are defined, followed by the rest of the name,
+using underscores to separate address@hidden convention to use
+underscores to separate words, called ``snake case'' (or
+``snake_case''), is the one suggested by the GNU coding standards.}.
+The same applies to exported macros, but in upper case. For example,
+the prototype of function @code{gal_box_border_from_center} is in
address@hidden, and the macro @code{GAL_POLYGON_MAX_CORNERS} is
+defined in @code{gal_polygon.h}. This makes also easier to look up
+their definitions.
+
address@hidden
+All installed libraries should have a name like @code{libgalbox.a}.
address@hidden itemize
@node Multithreaded programming, Documentation, Coding conventions, Program
source
@subsection Multithreaded programming
@@ -13013,3 +13044,8 @@ $ ./pgdemoXX
@bye
+
address@hidden Local Variables:
address@hidden mode: texinfo
address@hidden TeX-master: t
address@hidden End:
- [gnuastro-commits] [gnuastro] master updated (c011627 -> 3cfdb3e), Mohammad Akhlaghi, 2016/05/29
- [gnuastro-commits] (no subject),
Mohammad Akhlaghi <=
- [gnuastro-commits] (no subject), Mohammad Akhlaghi, 2016/05/29
- [gnuastro-commits] (no subject), Mohammad Akhlaghi, 2016/05/29
- [gnuastro-commits] (no subject), Mohammad Akhlaghi, 2016/05/29
- [gnuastro-commits] (no subject), Mohammad Akhlaghi, 2016/05/29
- [gnuastro-commits] (no subject), Mohammad Akhlaghi, 2016/05/29