From 522fd8577103d36aacbc4e22798b175178e8ece4 Mon Sep 17 00:00:00 2001
From: ROOL <code@riscosopen.org>
Date: Sun, 26 Feb 2023 22:52:45 +0000
Subject: [PATCH] Clean up pass

Detail:
  * Makefile created
  * Get version details from automatically maintained VersionNum
  * Use RMInfo from AsmUtils
  * References to $.SparkFS.h.common moved to Interface exports
  * Use POSIX style "thing.h" naming
  * Enable CI job

Version 1.50. Tagged as 'SparkARJ-1_50-1'
---
 !MkClean,fd7   | 30 ++++++++++++++++++++++++++++++
 !MkRam,fd7     | 29 +++++++++++++++++++++++++++++
 .gitignore     | 11 +++++++++++
 .gitlab-ci.yml |  3 +++
 Makefile       | 41 +++++++++++++++++++++++++++++++++++++++++
 c/arcs         | 36 +++++++++++++++++-------------------
 c/arjcat       | 37 +++++++++++++++++--------------------
 c/cat          | 37 +++++++++++++++++--------------------
 c/convert      | 38 +++++++++++++++++---------------------
 c/main         | 31 ++++++++++++-------------------
 c/pack         | 28 ++++++++++++----------------
 c/unpack       | 39 ++++++++++++++++++---------------------
 cmhg/ARJHdr    |  7 ++++---
 13 files changed, 228 insertions(+), 139 deletions(-)
 create mode 100644 !MkClean,fd7
 create mode 100644 !MkRam,fd7
 create mode 100644 .gitignore
 create mode 100644 .gitlab-ci.yml
 create mode 100644 Makefile

diff --git a/!MkClean,fd7 b/!MkClean,fd7
new file mode 100644
index 0000000..96b0353
--- /dev/null
+++ b/!MkClean,fd7
@@ -0,0 +1,30 @@
+|
+| Copyright (c) 2013, RISC OS Open Ltd
+| All rights reserved.
+|
+| Redistribution and use in source and binary forms, with or without
+| modification, are permitted provided that the following conditions are met:
+|     * Redistributions of source code must retain the above copyright
+|       notice, this list of conditions and the following disclaimer.
+|     * Redistributions in binary form must reproduce the above copyright
+|       notice, this list of conditions and the following disclaimer in the
+|       documentation and/or other materials provided with the distribution.
+|     * Neither the name of RISC OS Open Ltd nor the names of its contributors
+|       may be used to endorse or promote products derived from this software
+|       without specific prior written permission.
+|
+| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+| ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+| LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+| CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+| SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+| INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+| CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+| ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+| POSSIBILITY OF SUCH DAMAGE.
+|
+Dir <Obey$Dir>
+amu_machine clean
+stripdepnd
diff --git a/!MkRam,fd7 b/!MkRam,fd7
new file mode 100644
index 0000000..c6b3b6b
--- /dev/null
+++ b/!MkRam,fd7
@@ -0,0 +1,29 @@
+|
+| Copyright (c) 2013, RISC OS Open Ltd
+| All rights reserved.
+|
+| Redistribution and use in source and binary forms, with or without
+| modification, are permitted provided that the following conditions are met:
+|     * Redistributions of source code must retain the above copyright
+|       notice, this list of conditions and the following disclaimer.
+|     * Redistributions in binary form must reproduce the above copyright
+|       notice, this list of conditions and the following disclaimer in the
+|       documentation and/or other materials provided with the distribution.
+|     * Neither the name of RISC OS Open Ltd nor the names of its contributors
+|       may be used to endorse or promote products derived from this software
+|       without specific prior written permission.
+|
+| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+| ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+| LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+| CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+| SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+| INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+| CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+| ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+| POSSIBILITY OF SUCH DAMAGE.
+|
+Dir <Obey$Dir>
+amu_machine standalone THROWBACK=-throwback
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c6aca9e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,11 @@
+/aif/
+/aof/
+/gpa/
+/h/ARJHdr
+/i/
+/linked/
+/Makefile.d
+/o/
+/objs/
+/od/
+/rm/
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..3db77ff
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,3 @@
+include:
+  - project: 'Support/CI'
+    file: '/SparkARJ.yml'
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..aaab8ef
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,41 @@
+#
+# Copyright (c) 2023, RISC OS Open Ltd
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in the
+#       documentation and/or other materials provided with the distribution.
+#     * Neither the name of RISC OS Open Ltd nor the names of its contributors
+#       may be used to endorse or promote products derived from this software
+#       without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# Makefile for ARJ (SparkFS module)
+#
+
+COMPONENT    = SparkARJ
+TARGET       = ARJ
+OBJS         = arcs arjcat cat convert info \
+               main pack unpack
+LIBS         = ${ASMUTILS} ${SPARKLIB}
+HDRS         =
+CUSTOMRES    = no
+
+include CModule
+
+# Dynamic dependencies:
diff --git a/c/arcs b/c/arcs
index 813b6d0..316031b 100644
--- a/c/arcs
+++ b/c/arcs
@@ -29,25 +29,23 @@
 #include <string.h>
 #include <ctype.h>
 
-
-#include "h.kernel"
-#include "h.swis"
-
-#include "^.Shared.h.zflex"
-
-#include "$.SparkFS.h.common"
-
-#include "^.Shared.h.sfs"
-#include "^.Shared.h.sarcfs"
-#include "^.Shared.h.zbuffer"
-#include "^.Shared.h.err"
-
-#include "h.convert"
-#include "h.cat"
-#include "h.arcs"
-#include "h.unpack"
-#include "h.pack"
-#include "h.arj"
+#include "kernel.h"
+#include "swis.h"
+
+#include "Interface/SparkFS.h"
+
+#include "SparkLib/zflex.h"
+#include "SparkLib/sfs.h"
+#include "SparkLib/sarcfs.h"
+#include "SparkLib/zbuffer.h"
+#include "SparkLib/err.h"
+
+#include "convert.h"
+#include "cat.h"
+#include "arcs.h"
+#include "unpack.h"
+#include "pack.h"
+#include "arj.h"
 
 
 /*****************************************************************************/
diff --git a/c/arjcat b/c/arjcat
index db65249..87d3e44 100644
--- a/c/arjcat
+++ b/c/arjcat
@@ -30,26 +30,23 @@
 #include <ctype.h>
 #include <time.h>
 
-
-
-#include "h.kernel"
-#include "h.swis"
-
-#include "^.Shared.h.zflex"
-
-#include "$.SparkFS.h.common"
-
-#include "^.Shared.h.sfs"
-#include "^.Shared.h.sarcfs"
-#include "^.Shared.h.zbuffer"
-#include "^.Shared.h.zmsdos"
-#include "^.Shared.h.zfile"
-#include "^.Shared.h.err"
-
-#include "h.arcs"
-#include "h.convert"
-#include "h.arj"
-#include "h.arjint"
+#include "kernel.h"
+#include "swis.h"
+
+#include "Interface/SparkFS.h"
+
+#include "SparkLib/zflex.h"
+#include "SparkLib/sfs.h"
+#include "SparkLib/sarcfs.h"
+#include "SparkLib/zbuffer.h"
+#include "SparkLib/zmsdos.h"
+#include "SparkLib/zfile.h"
+#include "SparkLib/err.h"
+
+#include "arcs.h"
+#include "convert.h"
+#include "arj.h"
+#include "arjint.h"
 
 
 /*****************************************************************************/
diff --git a/c/cat b/c/cat
index 0aa9a2c..30cc682 100644
--- a/c/cat
+++ b/c/cat
@@ -30,26 +30,23 @@
 #include <ctype.h>
 #include <time.h>
 
-
-#include "h.kernel"
-#include "h.swis"
-
-#include "^.Shared.h.zflex"
-
-#include "$.SparkFS.h.common"
-
-#include "^.Shared.h.sfs"
-#include "^.Shared.h.sarcfs"
-#include "^.Shared.h.zbuffer"
-#include "^.Shared.h.zmsdos"
-#include "^.Shared.h.zfile"
-#include "^.Shared.h.err"
-
-#include "h.arcs"
-#include "h.convert"
-#include "h.arj"
-
-#include "h.cat"
+#include "kernel.h"
+#include "swis.h"
+
+#include "Interface/SparkFS.h"
+
+#include "SparkLib/zflex.h"
+#include "SparkLib/sfs.h"
+#include "SparkLib/sarcfs.h"
+#include "SparkLib/zbuffer.h"
+#include "SparkLib/zmsdos.h"
+#include "SparkLib/zfile.h"
+#include "SparkLib/err.h"
+
+#include "arcs.h"
+#include "convert.h"
+#include "arj.h"
+#include "cat.h"
 
 
 
diff --git a/c/convert b/c/convert
index 2557be4..245388b 100644
--- a/c/convert
+++ b/c/convert
@@ -29,27 +29,23 @@
 #include <string.h>
 #include <ctype.h>
 
-
-
-#include "h.kernel"
-#include "h.swis"
-
-#include "^.Shared.h.zflex"
-
-#include "$.SparkFS.h.common"
-
-#include "^.Shared.h.sfs"
-#include "^.Shared.h.zbuffer"
-#include "$.SparkFS.FS.h.RMInfo"
-#include "^.Shared.h.sinterface"
-#include "^.Shared.h.err"
-
-#include "h.arcs"
-#include "h.unpack"
-#include "h.pack"
-#include "h.cat"
-
-#include "h.convert"
+#include "kernel.h"
+#include "swis.h"
+
+#include "AsmUtils/rminfo.h"
+#include "Interface/SparkFS.h"
+
+#include "SparkLib/zflex.h"
+#include "SparkLib/sfs.h"
+#include "SparkLib/zbuffer.h"
+#include "SparkLib/sinterface.h"
+#include "SparkLib/err.h"
+
+#include "arcs.h"
+#include "unpack.h"
+#include "pack.h"
+#include "cat.h"
+#include "convert.h"
 
 
 
diff --git a/c/main b/c/main
index 2242da5..57d11a2 100644
--- a/c/main
+++ b/c/main
@@ -32,28 +32,21 @@
 #include <time.h>
 #include <locale.h>
 
+#include "kernel.h"
+#include "swis.h"
 
+#include "Interface/SparkFS.h"
 
-#include "h.kernel"
-#include "h.swis"
+#include "SparkLib/zflex.h"
+#include "SparkLib/sfs.h"
+#include "SparkLib/zbuffer.h"
+#include "SparkLib/sinterface.h"
+#include "SparkLib/err.h"
 
-#include "^.Shared.h.zflex"
-
-#include "$.SparkFS.h.common"
-
-#include "^.Shared.h.sfs"
-#include "^.Shared.h.zbuffer"
-
-#include "^.Shared.h.sinterface"
-
-#include "^.Shared.h.err"
-
-#include "h.arcs"
-#include "h.cat"
-
-#include "h.convert"
-
-#include "h.main"
+#include "arcs.h"
+#include "cat.h"
+#include "convert.h"
+#include "main.h"
 
 
 
diff --git a/c/pack b/c/pack
index eba0e22..403e55a 100644
--- a/c/pack
+++ b/c/pack
@@ -29,25 +29,21 @@
 #include <string.h>
 #include <ctype.h>
 
+#include "kernel.h"
+#include "swis.h"
 
+#include "Interface/SparkFS.h"
 
-#include "h.kernel"
-#include "h.swis"
+#include "SparkLib/zflex.h"
+#include "SparkLib/zbuffer.h"
+#include "SparkLib/sfs.h"
+#include "SparkLib/err.h"
 
-#include "^.Shared.h.zflex"
-
-#include "$.SparkFS.h.common"
-
-#include "^.Shared.h.zbuffer"
-#include "^.Shared.h.sfs"
-
-#include "^.Shared.h.err"
-
-#include "h.convert"
-#include "h.cat"
-#include "h.arcs"
-#include "h.unpack"
-#include "h.pack"
+#include "convert.h"
+#include "cat.h"
+#include "arcs.h"
+#include "unpack.h"
+#include "pack.h"
 
 
 
diff --git a/c/unpack b/c/unpack
index 923aa5a..687db64 100644
--- a/c/unpack
+++ b/c/unpack
@@ -29,27 +29,24 @@
 #include <string.h>
 #include <ctype.h>
 
-
-#include "h.kernel"
-#include "h.swis"
-
-#include "^.Shared.h.zflex"
-
-#include "$.SparkFS.h.common"
-
-#include "^.Shared.h.sfs"
-#include "^.Shared.h.zbuffer"
-#include "^.Shared.h.zmsdos"
-#include "^.Shared.h.zfile"
-#include "^.Shared.h.err"
-
-#include "h.convert"
-#include "h.cat"
-#include "h.arcs"
-#include "h.arj"
-#include "h.arjint"
-
-#include "h.unpack"
+#include "kernel.h"
+#include "swis.h"
+
+#include "Interface/SparkFS.h"
+
+#include "SparkLib/zflex.h"
+#include "SparkLib/sfs.h"
+#include "SparkLib/zbuffer.h"
+#include "SparkLib/zmsdos.h"
+#include "SparkLib/zfile.h"
+#include "SparkLib/err.h"
+
+#include "convert.h"
+#include "cat.h"
+#include "arcs.h"
+#include "arj.h"
+#include "arjint.h"
+#include "unpack.h"
 
 
 
diff --git a/cmhg/ARJHdr b/cmhg/ARJHdr
index 92a012d..0233b7c 100644
--- a/cmhg/ARJHdr
+++ b/cmhg/ARJHdr
@@ -23,11 +23,12 @@
 ;
 ;->cmhg.ARJ
 ;
+#include "VersionNum"
 
 initialisation-code: ARJ_initialise
 
 ; service-call-handler: ARJ_service
 
-title-string: ARJ
-
-help-string: ARJ 1.50
+title-string:        ARJ
+date-string:         Module_Date_CMHG
+help-string:         ARJ Module_MajorVersion_CMHG Module_MinorVersion_CMHG
-- 
GitLab