00001
00034 #include "version.h"
00035
00036 #include "globals.h"
00037 #include "legal.h"
00038 #include "output.h"
00039 #include "find.h"
00040
00041 #ifndef WIN32
00042 #undef BUILD
00043 #include "build.h"
00044 #endif
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00079 STATUS legal_notice(void)
00080 {
00081 char *buildinfo = strstr(BUILD,":");
00082
00083
00084 char copyright[1024] = "GridLAB-D " COPYRIGHT;
00085 char *end = strchr(copyright,'\n');
00086 int surpress = global_suppress_repeat_messages;
00087 global_suppress_repeat_messages = 0;
00088 while ((end = strchr(copyright,'\n'))!=NULL) {
00089 *end = ' ';
00090 }
00091 if (find_file(copyright,NULL,FF_EXIST)==NULL)
00092 {
00093 int build = buildinfo ? atoi(strstr(BUILD,":")+1) : 0;
00094 if (build>0)
00095 {
00096 output_message("GridLAB-D Version %d.%02d.%03d (build %d of " BRANCH ")\n" COPYRIGHT
00097 "", global_version_major, global_version_minor,REV_PATCH,build);
00098 }
00099 else
00100 output_message("GridLAB-D Version %d.%02d."
00101 #ifdef WIN32
00102 #ifdef _DEBUG
00103 "WIN32-DEBUG"
00104 #else
00105 "WIN32-RELEASE"
00106 #endif
00107 #else
00108 "DEV"
00109 #endif
00110 " (" BRANCH ")\n" COPYRIGHT
00111 "", global_version_major, global_version_minor);
00112 }
00113 global_suppress_repeat_messages = surpress;
00114 return SUCCESS;
00115 }
00116
00120 STATUS legal_license(void)
00121 {
00122 int surpress = global_suppress_repeat_messages;
00123 global_suppress_repeat_messages = 0;
00124 output_message(
00125 COPYRIGHT
00126 "\n"
00127 "1. Battelle Memorial Institute (hereinafter Battelle) hereby grants\n"
00128 " permission to any person or entity lawfully obtaining a copy of\n"
00129 " this software and associated documentation files (hereinafter \"the\n"
00130 " Software\") to redistribute and use the Software in source and\n"
00131 " binary forms, with or without modification. Such person or entity\n"
00132 " may use, copy, modify, merge, publish, distribute, sublicense,\n"
00133 " and/or sell copies of the Software, and may permit others to do so,\n"
00134 " subject to the following conditions:\n"
00135 " - Redistributions of source code must retain the above copyright\n"
00136 " notice, this list of conditions and the following disclaimers.\n"
00137 " - Redistributions in binary form must reproduce the above copyright\n"
00138 " notice, this list of conditions and the following disclaimer in\n"
00139 " the documentation and/or other materials provided with the\n"
00140 " distribution.\n"
00141 " - Other than as used herein, neither the name Battelle Memorial\n"
00142 " Institute or Battelle may be used in any form whatsoever without\n"
00143 " the express written consent of Battelle.\n"
00144 "2. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n"
00145 " \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n"
00146 " LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n"
00147 " A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BATTELLE OR\n"
00148 " CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n"
00149 " EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n"
00150 " PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n"
00151 " PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n"
00152 " OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n"
00153 " NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n"
00154 " SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
00155 "3. The Software was produced by Battelle under Contract No.\n"
00156 " DE-AC05-76RL01830 with the Department of Energy. The U.S. Government\n"
00157 " is granted for itself and others acting on its behalf a nonexclusive,\n"
00158 " paid-up, irrevocable worldwide license in this data to reproduce,\n"
00159 " prepare derivative works, distribute copies to the public, perform\n"
00160 " publicly and display publicly, and to permit others to do so. The\n"
00161 " specific term of the license can be identified by inquiry made to\n"
00162 " Battelle or DOE. Neither the United States nor the United States\n"
00163 " Department of Energy, nor any of their employees, makes any warranty,\n"
00164 " express or implied, or assumes any legal liability or responsibility\n"
00165 " for the accuracy, completeness or usefulness of any data, apparatus,\n"
00166 " product or process disclosed, or represents that its use would not\n"
00167 " infringe privately owned rights.\n"
00168 "\n"
00169 );
00170 global_suppress_repeat_messages = surpress;
00171 return SUCCESS;
00172 }
00173