File: iso2meshver.m

package info (click to toggle)
octave-iso2mesh 1.9.8%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 11,128 kB
  • sloc: cpp: 11,982; ansic: 10,158; sh: 365; makefile: 59
file content (41 lines) | stat: -rw-r--r-- 1,173 bytes parent folder | download
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
function [major, minor, patchnum, extra] = iso2meshver
%
% [major,minor,patchnum,extra]=iso2meshver
%      or
% v=iso2meshver
%
% get the version number of iso2mesh toolbox
%
% author: Qianqian Fang, <q.fang at neu.edu>
%
% output:
%    if you ask for a single output:
%      v: a string denotes the current version number; the string is
%       typically in the following format: "major.minor.patch-extra"
%       where major/minor/patch are typically integers, and extra can
%       be an arbitrary string and is optional
%    if you ask for 4 outputs:
%     [major,minor,patchnum,extra] are each field of the version string
%
% -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net)
%

major = 1;
minor = 9;
patchnum = 5;
extra = '$Rev::     $';
extra = regexprep(extra, '[\s$:]', '');

iso2meshvstr = sprintf('%d.%d.%d', major, minor, patchnum);
if (~isempty(extra))
    iso2meshvstr = [iso2meshvstr '-' extra];
end

if (nargout == 0)
    fprintf(1, 'iso2mesh toolbox version: %s\n', iso2meshvstr);
    clear major;
elseif (nargout == 1)
    major = iso2meshvstr;
elseif (nargout ~= 4)
    error('you need to return either 1 or 4 output variables');
end