00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 1999-2008 Soeren Sonnenburg 00008 * Copyright (C) 1999-2008 Fraunhofer Institute FIRST and Max-Planck-Society 00009 */ 00010 00011 #include "lib/common.h" 00012 #include "lib/versionstring.h" 00013 #include "lib/io.h" 00014 #include "lib/config.h" 00015 00016 #ifndef VERSION_H__ 00017 #define VERSION_H__ 00018 /* Class Version provides information of the version of shogun that is 00019 * currently used, for example the svn revision, time and date of compile and 00020 * compilation and linkflags used. 00021 */ 00022 class CVersion 00023 { 00024 public: 00025 CVersion(); 00026 ~CVersion(); 00027 00028 static inline void print_version() 00029 { 00030 SG_SPRINT("shogun (%s/%s/%s%d)\n\n", TARGET, MACHINE, VERSION_RELEASE, version_revision); 00031 SG_SPRINT("Copyright (C) 1999-2008 Fraunhofer Institute FIRST and Max-Planck-Society\n"); 00032 SG_SPRINT("Written (W) 2000-2008 Soeren Sonnenburg, Gunnar Raetsch et al.\n\n"); 00033 #ifdef GPL 00034 SG_SPRINT("This is free software; see the source for copying conditions. There is NO\n"); 00035 SG_SPRINT("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"); 00036 #endif 00037 SG_SPRINT( "( configure options: \"%s\" compile flags: \"%s\" link flags: \"%s\" )\n", CONFIGURE_OPTIONS, COMPFLAGS_CPP, LINKFLAGS); 00038 } 00039 00040 static inline const char* get_version_extra() 00041 { 00042 return version_extra; 00043 } 00044 00045 static inline const char* get_version_release() 00046 { 00047 return version_release; 00048 } 00049 00050 static inline int32_t get_version_revision() 00051 { 00052 return version_revision; 00053 } 00054 00055 static inline int32_t get_version_year() 00056 { 00057 return version_year; 00058 } 00059 00060 static inline int32_t get_version_month() 00061 { 00062 return version_month; 00063 } 00064 00065 static inline int32_t get_version_day() 00066 { 00067 return version_day; 00068 } 00069 00070 static inline int32_t get_version_hour() 00071 { 00072 return version_hour; 00073 } 00074 00075 static inline int32_t get_version_minute() 00076 { 00077 return version_year; 00078 } 00079 00080 static inline int64_t get_version_in_minutes() 00081 { 00082 return ((((version_year)*12 + version_month)*30 + version_day)* 24 + version_hour)*60 + version_minute; 00083 } 00084 00085 static const char version_release[128]; 00086 static const char version_extra[128]; 00087 00088 static const int32_t version_revision; 00089 static const int32_t version_year; 00090 static const int32_t version_month; 00091 static const int32_t version_day; 00092 static const int32_t version_hour; 00093 static const int32_t version_minute; 00094 }; 00095 #endif