-
Notifications
You must be signed in to change notification settings - Fork 0
/
hdscopyright.m
78 lines (67 loc) · 2.34 KB
/
hdscopyright.m
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
function hdscopyright(varargin)
%HDSCOPYRIGHT Displays information about the HDS Toolbox version.
% HDSCOPYRIGHT displays information about the HDS Toolbox version and
% displays a link to the site which supports the HDS Toolbox.
% Copyright (c) 2012, J.B.Wagenaar
% This source file is subject to version 3 of the GPL license,
% that is bundled with this package in the file LICENSE, and is
% available online at http://www.gnu.org/licenses/gpl.txt
%
% This source file can be linked to GPL-incompatible facilities,
% produced or made available by MathWorks, Inc.
persistent previouslyRun
try
error(nargchk(0, 1, nargin));
catch ME
throwAsCaller(MException('HDS:hdscopyright', ME.message));
end
if isempty(previouslyRun)
previouslyRun = false;
mlock;
end
% Determine if the message should be shown
showMessage = false;
if nargin
if strcmp(varargin{1},'init')
if ~previouslyRun
showMessage = true;
end
else
throwAsCaller(MException('HDS:hdscopyright','Incorrect input argument.'));
end
else
showMessage = true;
end
% Get Version from HDSToolbox_README.txt
try
fid = fopen('README_HDS.txt');
str = '';
while ischar(str);
str = fgets(fid);
if strfind(lower(str), 'version')
break
end
end
fclose(fid);
catch ME %#ok<NASGU>
str = 'Version unknown.';
end
% -- -- -- -- -- Display message to user -- -- -- -- -- --
if showMessage
%Currently no links, but could change in future.
if usejava('desktop')
HDS.displaymessage('-- -- -- -- -- --',2,'\n','');
fprintf('HIERARCHICAL DATA STORAGE TOOLBOX\n');
fprintf('Copyright: 2009-2012 J.B. Wagenaar\n');
fprintf('%s',str);
HDS.displaymessage('-- -- -- -- -- --',2,'','\n');
else
HDS.displaymessage('-- -- -- -- -- --',2,'\n','');
fprintf('HIERARCHICAL DATA STORAGE TOOLBOX\n');
fprintf('Copyright: 2009-2012 J.B. Wagenaar\n');
fprintf('%s',str);
HDS.displaymessage('-- -- -- -- -- --',2,'','\n');
end
previouslyRun = true;
end
end