From e3760e2a922d904572b2c82dcaffeac907a6825c Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Wed, 17 Sep 2014 09:49:59 +0200
Subject: [PATCH] move setfilem and geterrstr to individual functions

---
 Makefile           |  2 ++
 ReadMatLabDesign.F | 24 ------------------------
 geterrstr.for      | 32 ++++++++++++++++++++++++++++++++
 setfilem.for       | 32 ++++++++++++++++++++++++++++++++
 4 files changed, 66 insertions(+), 24 deletions(-)
 create mode 100644 geterrstr.for
 create mode 100644 setfilem.for

diff --git a/Makefile b/Makefile
index 1404d6b..e77d2a9 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,8 @@ MOD_OBJS = \
 	dlfcn.o
 
 OBJS = \
+	setfilem.o \
+	geterrstr.o \
 	amh2.o \
 	gammln.o \
 	int2seq2.o \
diff --git a/ReadMatLabDesign.F b/ReadMatLabDesign.F
index 577270c..e977d06 100644
--- a/ReadMatLabDesign.F
+++ b/ReadMatLabDesign.F
@@ -248,27 +248,3 @@ C
 
       RETURN
       END
-
-C -----------------------------------------
-C To make dynamic the name of the .m file
-C -----------------------------------------
-	SUBROUTINE SETFILEM(string1,string2)
-!DEC$ ATTRIBUTES DLLEXPORT, ALIAS:'setfilem_' :: SETFILEM
-	CHARACTER*200 string1,string2,mfile,pathmfile
-      COMMON /M/ mfile, pathmfile
-      mfile     = string1
-      pathmfile = string2
-	RETURN
-      END
-
-C --------------------
-C To get MatLab errors
-C --------------------
-      SUBROUTINE GETERRSTR(matlaberror)
-!DEC$ ATTRIBUTES DLLEXPORT, ALIAS:'geterrstr_' :: GETERRSTR
-      CHARACTER*1024 matlaberror
-      CHARACTER*1024 buffer
-      COMMON /ERRBUFFER/ buffer
-	 matlaberror = buffer
-      RETURN
-      END
diff --git a/geterrstr.for b/geterrstr.for
new file mode 100644
index 0000000..5770e0d
--- /dev/null
+++ b/geterrstr.for
@@ -0,0 +1,32 @@
+C --------------------------------------------------------------------
+C This file crates matlabdll.dll whih is ment to read the .m file
+C
+C Copyright (C) 2010-2014 European Commission
+C
+C This file is part of Program DMM
+C
+C DMM is free software developed at the Joint Research Centre of the
+C European Commission: you can redistribute it and/or modify it under
+C the terms of the GNU General Public License as published by
+C the Free Software Foundation, either version 3 of the License, or
+C (at your option) any later version.
+C
+C DMM is distributed in the hope that it will be useful,
+C but WITHOUT ANY WARRANTY; without even the implied warranty of
+C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+C GNU General Public License for more details.
+C
+C You should have received a copy of the GNU General Public License
+C along with DMM.  If not, see <http://www.gnu.org/licenses/>.
+C ---------------------------------------------------------------------
+C --------------------
+C To get MatLab errors
+C --------------------
+      SUBROUTINE GETERRSTR(matlaberror)
+!DEC$ ATTRIBUTES DLLEXPORT, ALIAS:'geterrstr_' :: GETERRSTR
+      CHARACTER*1024 matlaberror
+      CHARACTER*1024 buffer
+      COMMON /ERRBUFFER/ buffer
+	 matlaberror = buffer
+      RETURN
+      END
diff --git a/setfilem.for b/setfilem.for
new file mode 100644
index 0000000..7c9f20b
--- /dev/null
+++ b/setfilem.for
@@ -0,0 +1,32 @@
+C --------------------------------------------------------------------
+C This file crates matlabdll.dll whih is ment to read the .m file
+C
+C Copyright (C) 2010-2014 European Commission
+C
+C This file is part of Program DMM
+C
+C DMM is free software developed at the Joint Research Centre of the
+C European Commission: you can redistribute it and/or modify it under
+C the terms of the GNU General Public License as published by
+C the Free Software Foundation, either version 3 of the License, or
+C (at your option) any later version.
+C
+C DMM is distributed in the hope that it will be useful,
+C but WITHOUT ANY WARRANTY; without even the implied warranty of
+C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+C GNU General Public License for more details.
+C
+C You should have received a copy of the GNU General Public License
+C along with DMM.  If not, see <http://www.gnu.org/licenses/>.
+C ---------------------------------------------------------------------
+C -----------------------------------------
+C To make dynamic the name of the .m file
+C -----------------------------------------
+	SUBROUTINE SETFILEM(string1,string2)
+!DEC$ ATTRIBUTES DLLEXPORT, ALIAS:'setfilem_' :: SETFILEM
+	CHARACTER*200 string1,string2,mfile,pathmfile
+      COMMON /M/ mfile, pathmfile
+      mfile     = string1
+      pathmfile = string2
+	RETURN
+      END
-- 
GitLab