Commit 18d287bc authored by Andrew Cohen's avatar Andrew Cohen

support for C and matlab, updated preamble (C)

parent 5d47f006
/***********************************************************************
* Copyright 2011-2016 Andrew Cohen
*
* This file is part of LEVer - the tool for stem cell lineaging. See
* http://n2t.net/ark:/87918/d9rp4t for details
*
* LEVer 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.
*
* LEVer 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 LEVer in file "gnu gpl v3.txt". If not, see
* <http://www.gnu.org/licenses/>.
*
***********************************************************************/
\ No newline at end of file
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Copyright 2011-2016 Andrew Cohen, Eric Wait, Mark Winter, Walt
% Mankowski
% Copyright 2011-2016 Andrew Cohen
%
% This file is part of LEVer - the tool for stem cell lineaging. See
% http://n2t.net/ark:/87918/d9rp4t for details
......
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Copyright 2011-2016 Andrew Cohen, Eric Wait, Mark Winter, Walt
% Mankowski
% Copyright 2011-2016 Andrew Cohen
%
% This file is part of LEVer - the tool for stem cell lineaging. See
% http://n2t.net/ark:/87918/d9rp4t for details
......@@ -35,3 +33,12 @@ for dd=1:length(dlist)
end
license.goHeader('.\');
% c files
dlist=dir('..\c');
for dd=1:length(dlist)
if ~dlist(dd).isdir || length(dlist(dd).name)<4
continue
end
license.goHeader(['.\' dlist(dd).name '\'],1);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Copyright 2011-2016 Andrew Cohen, Eric Wait, Mark Winter, Walt
% Mankowski
% Copyright 2011-2016 Andrew Cohen
%
% This file is part of LEVer - the tool for stem cell lineaging. See
% http://n2t.net/ark:/87918/d9rp4t for details
......@@ -22,7 +20,6 @@
% <http://www.gnu.org/licenses/>.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function txt=getFileText(filename)
fid = fopen(filename,'rt');
......
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Copyright 2011-2016 Andrew Cohen, Eric Wait, Mark Winter, Walt
% Mankowski
% Copyright 2011-2016 Andrew Cohen
%
% This file is part of LEVer - the tool for stem cell lineaging. See
% http://n2t.net/ark:/87918/d9rp4t for details
......@@ -24,38 +22,28 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Copyright 2011-2016 Andrew Cohen, Eric Wait, Mark Winter, Walt
% Mankowski
%
% This file is part of LEVer - the tool for stem cell lineaging. See
% http://n2t.net/ark:/87918/d9rp4t for details
%
% LEVer 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.
%
% LEVer 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 LEVer in file "gnu gpl v3.txt". If not, see
% <http://www.gnu.org/licenses/>.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function goHeader(folder)
flist = dir(fullfile(folder, '*.m'));
function goHeader(folder,bC)
if nargin<2
bC=0;
end
if bC
flist = dir(fullfile(folder, '*.cpp'));
flist = [flist;dir(fullfile(folder, '*.h'))];
% note - this is the old token for the c code. this will need to change
% to ******* as per the new licenseheader.c
strToken='//////////';
txtPreamble = license.getFileText('.\+license\LicenseHeader.c');
else
flist = dir(fullfile(folder, '*.m'));
strToken='%%%%%%%%%%';
txtPreamble = license.getFileText('.\+license\LicenseHeader.m');
end
for ff=1:length(flist)
txt = license.getFileText(fullfile(folder,flist(ff).name));
txtPreamble = license.getFileText('.\+license\LicenseHeader.m');
idxPreamble = find(cellfun(@(x) ~isempty(strfind(x,'%%%%%%%%%%')),txt));
idxPreamble = find(cellfun(@(x) ~isempty(strfind(x,strToken)),txt),2);
if length(idxPreamble)~=2
fprintf(1,'found file with no license: %s\n',flist(ff).name);
% find the first non-comment line
......
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Copyright 2011-2016 Andrew Cohen, Eric Wait, Mark Winter, Walt
% Mankowski
% Copyright 2011-2016 Andrew Cohen
%
% This file is part of LEVer - the tool for stem cell lineaging. See
% http://n2t.net/ark:/87918/d9rp4t for details
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment