File: version.hpp

package info (click to toggle)
seqtools 4.44.1%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 28,492 kB
  • sloc: cpp: 53,636; sh: 12,232; makefile: 386
file content (179 lines) | stat: -rwxr-xr-x 9,708 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/*  File: version.h
 *  Author: Ed Griffiths
 *  Copyright (c) 2010 - 2012 Genome Research Ltd
 * ---------------------------------------------------------------------------
 * SeqTools is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 3
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 * or see the on-line version at http://www.gnu.org/copyleft/gpl.txt
 * ---------------------------------------------------------------------------
 * This file is part of the SeqTools sequence analysis package, 
 * written by
 *      Gemma Barson      (Sanger Institute, UK)  <gb10@sanger.ac.uk>
 * 
 * based on original code by
 *      Erik Sonnhammer   (SBC, Sweden)           <Erik.Sonnhammer@sbc.su.se>
 * 
 * and utilizing code taken from the AceDB and ZMap packages, written by
 *      Richard Durbin    (Sanger Institute, UK)  <rd@sanger.ac.uk>
 *      Jean Thierry-Mieg (CRBM du CNRS, France)  <mieg@kaa.crbm.cnrs-mop.fr>
 *      Ed Griffiths      (Sanger Institute, UK)  <edgrif@sanger.ac.uk>
 *      Roy Storey        (Sanger Institute, UK)  <rds@sanger.ac.uk>
 *      Malcolm Hinsley   (Sanger Institute, UK)  <mh17@sanger.ac.uk>
 *
 * Description: Macros to support version numbering of libraries and
 *              applications in SeqTools.
 *----------------------------------------------------------------------------
 */

#ifndef UT_VERSION_H
#define UT_VERSION_H


/* Tools for creating version strings in an application or library.          */
/*                                                                           */


/* This macro creates a routine that must be provided by all applications    */
/* that use the ACECB kernel code or libace. libace routines expect to be    */
/* able to query the date on which the applications main routine was         */
/* compiled so that this information can be displayed to the user.           */
/* The function must have this prototype and must return a string that gives */
/* the build date:                                                           */
/*                                                                           */
char *utAppGetCompileDate(void) ;
/* The acedb                                                                 */
/* makefile is arranged so that the main routine is recompiled every time    */
/* the application is relinked. This means that the date represents the      */
/* 'build' date of the application.                                          */
/*                                                                           */
/* Code the macro by simply putting it in the .c file that contains the      */
/* main function of the application, it's probably best to put it just       */
/* before or after the main function. Do not put a terminating ';' after     */
/* the macro, this will cause a compile error.                               */
/*                                                                           */
#define UT_COMPILE_PHRASE "Compiled on:"

#define UT_MAKE_GETCOMPILEDATEROUTINE()                                      \
char *utAppGetCompileDate(void) { return UT_COMPILE_PHRASE " " __DATE__ " " __TIME__ ; }



/* These tools assume that various numbers/strings are defined, e.g.         */
/*                                                                           */
/* #define SOME_TITLE   "UT library"         (definitive name for library)   */
/* #define SOME_DESC    "brief description"  (purpose of library - one liner)*/
/* #define SOME_VERSION 1                    (major version)                 */
/* #define SOME_RELEASE 0                    (minor version)                 */
/* #define SOME_UPDATE  1                    (latest fix number)             */
/*                                                                           */


/*  Use UT_MAKESTRING to make strings out of #define'd numbers.          
 *  (required because of the way ANSI preprocessor handles strings)      
 *  e.g. UT_MAKESTRING(6)  produces "6"                                 */   
#define UT_PUTSTRING(x) #x
#define UT_MAKESTRING(x) UT_PUTSTRING(x)


/* Make a single version number out of a version, release and update number.
 * NOTE that there should be no more than 100 (i.e. 0 - 99) revisions per    
 * version, or updates per revision, otherwise version will be wrong. */
#define UT_MAKE_VERSION_NUMBER(VERSION, RELEASE, UPDATE) \
((VERSION * 10000) + (RELEASE * 100) + UPDATE)


/* Make a single version string out of the version, release and update numbers */
#define UT_MAKE_VERSION_STRING(VERSION, RELEASE, UPDATE) \
UT_MAKESTRING(VERSION) "." UT_MAKESTRING(RELEASE) "." UT_MAKESTRING(UPDATE)


/* Make a title string containing the title of the application/library and the version. */
#define UT_MAKE_TITLE_STRING(TITLE, VERSION) \
TITLE " - " VERSION


/* Make a string containing the compile time and date */
#define UT_MAKE_COMPILE_DATE() \
__TIME__ " " __DATE__


/* Make a copyright string, where the copyright for the given year(s) (passed as a string, e.g. "2009 - 2010") */
#define UT_MAKE_COPYRIGHT_STRING(YEARS_STRING) \
"Copyright (c) " YEARS_STRING ": Genome Research Ltd."


/* Make a version-info string (has the package name and version string) */
#define UT_MAKE_VERSION_INFO_STRING(PACKAGE_NAME, VERSION_STRING) \
PACKAGE_NAME " - " VERSION_STRING


/* Make a licence string */
#define UT_MAKE_LICENCE_STRING(TITLE) \
TITLE" is distributed under the GNU General Public License; see http://www.gnu.org/copyleft/gpl.txt"


/* Define the authors of the SeqTools package. AUTHOR_LIST is a comma-separated list of all authors
 * that should be credited. AUTHOR_TEXT is a string containing the main authors. */
#define AUTHOR_LIST	   "Gemma Barson (Sanger Institute, UK) <gb10@sanger.ac.uk>",\
                           "Erik Sonnhammer (SBC, Sweden) <Erik.Sonnhammer@sbc.su.se>",\
                           "Jean Thierry-Mieg (CRBM du CNRS, France) <mieg@kaa.crbm.cnrs-mop.fr>",\
                           "Richard Durbin (Sanger Institute, UK) <rd@sanger.ac.uk>",\
                           "Ed Griffiths (Sanger Institute, UK) <edgrif@sanger.ac.uk>",\
                           "Roy Storey (Sanger Institute, UK) <rds@sanger.ac.uk>",\
                           "Malcolm Hinsley (Sanger Institute, UK) <mh17@sanger.ac.uk>"

#define AUTHOR_TEXT        "Gemma Barson <gb10@sanger.ac.uk>\n"\
                           "Erik Sonnhammer <Erik.Sonnhammer@sbc.su.se>"
                           
#define AUTHOR_TEXT_FULL   " Written by Gemma Barson <gb10@sanger.ac.uk>\n"\
                           " Based on original code by Erik Sonnhammer <Erik.Sonnhammer@sbc.su.se>"
                           


/*    Macro for creating a standard copyright string to be inserted into     
 *    compiled applications and libraries. The macro ensures a common        
 *    format for version numbers etc.                                        
 *                                                                           
 * The macro is a statement, NOT an expression, but does NOT require a       
 * terminating semi-colon. The macro should be coded like this:              
 *                                                                           
 *    UT_COPYRIGHT_STRING(prefix, title, description, copyright_years)       
 *                                                                           
 *    where  prefix is some a string locally used to prefix variables        
 *    where  title is a string of the form   "Appname  1.0.1"                
 *    where  description is of the form  "Application to blah, blah."        
 *    and    copyright_years is of the form  "2010", "2008-2010", "2008, 2010" etc.
 */
#define UT_COPYRIGHT(YEARS_STRING)                                                   \
"@(#) " UT_MAKE_COPYRIGHT_STRING(YEARS_STRING) "\n"                                  \
"@(#) \n"                                                                            \
"@(#) This file contains the above Sanger Informatics Group library, \n"             \
"@(#) " AUTHOR_TEXT "\n\n"                                                           \
"@(#) You may redistribute this software subject to the conditions in the \n"        \
"@(#) accompanying copyright file. Anyone interested in obtaining an up to date \n"  \
"@(#) version should contact one of the authors at the above email addresses. \n"


#define UT_COPYRIGHT_STRING(TITLE, VERSION, DESCRIPTION_STRING, COPYRIGHT_YEARS)     \
"@(#) \n"                                                                            \
"@(#) --------------------------------------------------------------------------\n"  \
"@(#) Title/Version:  " UT_MAKE_TITLE_STRING(TITLE, VERSION) "\n"                    \
"@(#)      Compiled:  " UT_MAKE_COMPILE_DATE "\n"                                    \
"@(#)   Description:  " DESCRIPTION_STRING "\n\n"                                    \
UT_COPYRIGHT()                                                                       \
"@(#) --------------------------------------------------------------------------\n"  \
"@(#) \n" ;


#endif	/* UT_VERSION_H */