Fix remaining copyright headers
[alexxy/gromacs.git] / src / gromacs / legacyheaders / copyrite.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5  * Copyright (c) 2001-2004, The GROMACS development team.
6  * Copyright (c) 2013, by the GROMACS development team, led by
7  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
8  * and including many others, as listed in the AUTHORS file in the
9  * top-level source directory and at http://www.gromacs.org.
10  *
11  * GROMACS is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public License
13  * as published by the Free Software Foundation; either version 2.1
14  * of the License, or (at your option) any later version.
15  *
16  * GROMACS is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with GROMACS; if not, see
23  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
25  *
26  * If you want to redistribute modifications to GROMACS, please
27  * consider that scientific software is very special. Version
28  * control is crucial - bugs must be traceable. We will be happy to
29  * consider code for inclusion in the official distribution, but
30  * derived work must not be called official GROMACS. Details are found
31  * in the README & COPYING files - if they are missing, get the
32  * official version at http://www.gromacs.org.
33  *
34  * To help us fund GROMACS development, we humbly ask that you cite
35  * the research papers on the package. Check out http://www.gromacs.org.
36  */
37 #ifndef _copyrite_h
38 #define _copyrite_h
39
40 #include <stdio.h>
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
46 /* Has to be a function, so we can get version number from the build system */
47 const char *GromacsVersion(void);
48
49 const char *Program(void);
50
51 const char *ShortProgram(void);
52
53 /* For both bromacs() and cool_quote() you have to provide a pointer to
54  * a string of reasonable length (say 256) and the string length. This
55  * is necessary to make the routines threadsafe and avoid allocating
56  * a new string each time. The retstring pointer will be the return value.
57  */
58 void
59 bromacs(char *retstring, int retsize);
60
61 /* For cool_quote, the number of the quote used will be returned in cqnum
62  * if it is non-NULL.
63  */
64 void
65 cool_quote(char *retstring, int retsize, int *cqnum);
66
67 void
68 gmx_thanx(FILE *fp);
69
70 void
71 please_cite(FILE *fp, const char *key);
72 /* Print a message asking to cite something... */
73
74 #ifdef __cplusplus
75 }
76
77 namespace gmx
78 {
79
80 class ProgramInfo;
81
82 /*! \brief
83  * Settings for printBinaryInformation().
84  *
85  * This class is used to specify what printBinaryInformation() prints.
86  */
87 class BinaryInformationSettings
88 {
89     public:
90         BinaryInformationSettings();
91
92         //! Print information about build settings.
93         BinaryInformationSettings &extendedInfo(bool bEnabled)
94         {
95             bExtendedInfo_ = bEnabled;
96             return *this;
97         }
98         //! Print copyright and license information.
99         BinaryInformationSettings &copyright(bool bEnabled)
100         {
101             bCopyright_ = bEnabled;
102             return *this;
103         }
104         //! Print a header line with "Generated by" text (for output files).
105         BinaryInformationSettings &generatedByHeader(bool bEnabled)
106         {
107             bGeneratedByHeader_ = bEnabled;
108             return *this;
109         }
110         //! Prefix each line with this string.
111         BinaryInformationSettings &linePrefix(const char *prefix)
112         {
113             prefix_ = prefix;
114             return *this;
115         }
116         //! Suffix each line with this string.
117         BinaryInformationSettings &lineSuffix(const char *suffix)
118         {
119             suffix_ = suffix;
120             return *this;
121         }
122
123     private:
124         bool        bExtendedInfo_;
125         bool        bCopyright_;
126         bool        bGeneratedByHeader_;
127         const char *prefix_;
128         const char *suffix_;
129
130         //! Needed to read the members without otherwise unnecessary accessors.
131         friend void printBinaryInformation(FILE *fp, const ProgramInfo &programInfo,
132                                            const BinaryInformationSettings &settings);
133 };
134
135 /*! \brief
136  * Print basic information about the executable.
137  *
138  * \param     fp           Where to print the information to.
139  * \param[in] programInfo  Program information object to use.
140  */
141 void printBinaryInformation(FILE *fp, const ProgramInfo &programInfo);
142 /*! \brief
143  * Print basic information about the executable with custom settings.
144  *
145  * \param     fp           Where to print the information to.
146  * \param[in] programInfo  Program information object to use.
147  * \param[in] settings     Specifies what to print.
148  *
149  * \see BinaryInformationSettings
150  */
151 void printBinaryInformation(FILE *fp, const ProgramInfo &programInfo,
152                             const BinaryInformationSettings &settings);
153
154 } // namespace gmx;
155
156 #endif
157
158 #endif  /* _copyright_h */