Commit 6c97fe3f authored by ROOL's avatar ROOL 🤖
Browse files

This commit was manufactured by cvs2git to create branch 'ART'.

Cherrypick from master 1997-05-08 13:42:38 UTC Kevin Bracey <kbracey@gitlab.riscosopen.org> 'ART branch (version 0.76) folded in':
    310/Modules/ABCLib,ffa
    310/Modules/BASIC64,ffa
    310/Modules/DDEUtils,ffa
    310/Modules/Network/URL/File,ffa
    310/Modules/Network/URL/URL,ffa
    310/Modules/SCSIFiler,ffa
    310/Modules/SerialUtil,ffa
    Makefile
    Modules/SSound,ffa
    ReadMe
    Resources/!Run,feb
    Resources/Germany/!Boot,feb
    Resources/UK/!Boot,feb
    Resources/UK/!Help
    c/main
    rm/DDEUtils,ffa
parent 194e8a50
*,ffb gitlab-language=bbcbasic linguist-language=bbcbasic linguist-detectable=true
c/** gitlab-language=c linguist-language=c linguist-detectable=true
# Copyright 1996 Acorn Computers Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Makefile for System
#
# ***********************************
# *** C h a n g e L i s t ***
# ***********************************
# Date Name Description
# ---- ---- -----------
# 08-Nov-94 AMcC Updated for Black build
# 15th Nov 1994 JRC Added SysPaths utility, replaced old 'abs' and 'rm'
# directories with a 'Modules' drectory. New 'abs'
# directory used to build SysPaths in
# 30-Jan-95 AMcC No longer installs 'recent' modules in 'Modules'
# Installs 360.Modules
# 31-Jan-95 AMcC No longer installs !Sprites23. Modules writable by owner
#
# 03-Jul-96 KJB Added 370 directory
#
# 24-Apr-97 KJB Made all copies file-by-file to prevent copying CVS
# directories. Removed 200 and 300 directories.
# Made SysPaths set Boot$OSVersion if not already set,
# and correct "3.50" to "350".
VPATH = @ <Support$Dir>
#
# Program specific options:
#
COMPONENT = System
APP = !${COMPONENT}
RDIR = Resources
LDIR = ${RDIR}.${LOCALE}
INSTDIR = ${INSTDIR}.${APP}
# Generic options:
#
MKDIR = cdir
AS = objasm
ATTR = -Attr
CC = cc
CMHG = cmhg
CP = copy
LD = link
RM = remove
SQUEEZE = squeeze
WIPE = -wipe
AFLAGS = ${THROWBACK} -depend !Depend -nocache -stamp -quit
CFLAGS = ${THROWBACK} -c -depend !Depend -fah ${INCLUDES} ${DFLAGS} -wp
CPFLAGS = ~cfr~v
SQFLAGS = -f
WFLAGS = ~c~v
#
# Libraries
#
CLIB = CLib:o.Stubs
OSLIB = OSLib:o.OSLib
#
# Include files
#
INCLUDES = -ISupport:,OS:
MODULES = \
310.Modules.ABCLib \
310.Modules.ABIMod \
310.Modules.BASIC64 \
310.Modules.Colours \
310.Modules.DDEUtils \
310.Modules.DDT \
310.Modules.FrontEnd \
310.Modules.Network.URL.File \
310.Modules.Network.URL.URL \
310.Modules.SCSIFiler \
310.Modules.SerialUtil \
370.Modules.DDEUtils \
370.Modules.DDT
FILES =\
${LDIR}.!Boot\
${LDIR}.!Help\
${RDIR}.!Run\
${RDIR}.!Sprites\
${RDIR}.!Sprites22\
${MODULES}\
abs.SysPaths
OBJS = o.main o.x
#
# Rule patterns
#
.SUFFIXES: .oz .od .asm
.c.o:; ${CC} ${CFLAGS} -ff -o $@ $<
.c.oz:; ${CC} ${CFLAGS} -ff -zM -zps1 -o $@ $<
.c.od:; ${CC} ${CFLAGS} -DTRACE=1 -g -o $@ $<
.asm.o:; ${AS} ${AFLAGS} $< $@
.asm.od:; ${AS} ${AFLAGS} -g $< $@
#
# Main rules:
#
all: ${FILES}
@echo ${COMPONENT}: All built (Disc)
install: ${FILES}
${MKDIR} ${INSTDIR}
${CP} ${LDIR}.!Boot ${INSTDIR}.!Boot ${CPFLAGS}
${CP} ${LDIR}.!Help ${INSTDIR}.!Help ${CPFLAGS}
${CP} ${RDIR}.!Run ${INSTDIR}.!Run ${CPFLAGS}
${CP} ${RDIR}.!Sprites ${INSTDIR}.!Sprites ${CPFLAGS}
${CP} ${RDIR}.!Sprites22 ${INSTDIR}.!Sprites22 ${CPFLAGS}
${CP} abs.SysPaths ${INSTDIR}.SysPaths ${CPFLAGS}
|
${MKDIR} ${INSTDIR}.Modules
${MKDIR} ${INSTDIR}.310
${MKDIR} ${INSTDIR}.310.Modules
${MKDIR} ${INSTDIR}.350
${MKDIR} ${INSTDIR}.350.Modules
${MKDIR} ${INSTDIR}.360
${MKDIR} ${INSTDIR}.360.Modules
${MKDIR} ${INSTDIR}.370
${MKDIR} ${INSTDIR}.370.Modules
${CP} 310.Modules.ABCLib ${INSTDIR}.310.Modules.* ${CPFLAGS}
${CP} 310.Modules.ABIMod ${INSTDIR}.310.Modules.* ${CPFLAGS}
${CP} 310.Modules.BASIC64 ${INSTDIR}.310.Modules.* ${CPFLAGS}
${CP} 310.Modules.Colours ${INSTDIR}.310.Modules.* ${CPFLAGS}
${CP} 310.Modules.DDEUtils ${INSTDIR}.310.Modules.* ${CPFLAGS}
${CP} 310.Modules.DDT ${INSTDIR}.310.Modules.* ${CPFLAGS}
${CP} 310.Modules.FrontEnd ${INSTDIR}.310.Modules.* ${CPFLAGS}
${CP} 310.Modules.SCSIFiler ${INSTDIR}.310.Modules.* ${CPFLAGS}
${CP} 310.Modules.SerialUtil ${INSTDIR}.310.Modules.* ${CPFLAGS}
${CP} 310.Modules.Network.URL.File ${INSTDIR}.310.Modules.Network.URL.* ${CPFLAGS}
${CP} 310.Modules.Network.URL.URL ${INSTDIR}.310.Modules.Network.URL.* ${CPFLAGS}
${CP} 370.Modules.DDEUtils ${INSTDIR}.370.Modules.* ${CPFLAGS}
${CP} 370.Modules.DDT ${INSTDIR}.370.Modules.* ${CPFLAGS}
${CP} Modules.SSound ${INSTDIR}.Modules.* ${CPFLAGS} # shouldn't be in here
|
${ATTR} -directories +wr ${INSTDIR}
${ATTR} -files +ol +or -ow +wr -ww ${INSTDIR}
${ATTR} -files -ol +or +ow +wr -ww ${INSTDIR}.Modules
${ATTR} -files -ol +or +ow +wr -ww ${INSTDIR}.310
${ATTR} -files -ol +or +ow +wr -ww ${INSTDIR}.350
${ATTR} -files -ol +or +ow +wr -ww ${INSTDIR}.360
${ATTR} -files -ol +or +ow +wr -ww ${INSTDIR}.370
|
@echo ${COMPONENT}: All installed (Disc)
clean:
${WIPE} o.* ${WFLAGS}
${WIPE} oz.* ${WFLAGS}
${WIPE} od.* ${WFLAGS}
${RM} abs.SysPaths
@echo ${COMPONENT}: cleaned
clean_all:
Access ${INSTDIR} rw/
Access ${INSTDIR}.* rw/
Access ${INSTDIR}.200.Modules rw/
Access ${INSTDIR}.200.Modules.* rw/
Access ${INSTDIR}.300.Modules rw/
Access ${INSTDIR}.300.Modules.* rw/
Access ${INSTDIR}.310.Modules rw/
Access ${INSTDIR}.310.Modules.* rw/
Access ${INSTDIR}.350.Modules rw/
Access ${INSTDIR}.350.Modules.* rw/
-Destroy ${OBJS} ${OBJSD} abs.SysPaths ${INSTDIR}.!Boot \
${INSTDIR}.!Help ${INSTDIR}.!Run ${INSTDIR}.!Sprites \
${INSTDIR}.!Sprites22 ${INSTDIR}.SysPaths
Wipe ${INSTDIR}.200 ${WFLAGS}R
Wipe ${INSTDIR}.300 ${WFLAGS}R
Wipe ${INSTDIR}.310 ${WFLAGS}R
Wipe ${INSTDIR}.350 ${WFLAGS}R
@echo ${COMPONENT}: cleaned
#
# Static dependencies:
#
abs.SysPaths: ${OBJS} ${OSLIB} ${CLIB}
${LD} -o $@ ${OBJS} ${OSLIB} ${CLIB}
${SQUEEZE} ${SQFLAGS} $@
abs.SysPathsD: ${OBJSD} ${OSLIB} ${CLIB}
${LD} -o $@ -debug ${OBJSD} ${OSLIB} ${CLIB}
#---------------------------------------------------------------------------
# Dynamic dependencies:
Note: the !Run file is the only one that contains the version number.
200.Modules.CLib 1.02 (07 Dec 1988)
200.Modules.Colours 0.51 (22 Nov 1988)
200.Modules.FPEmulator 2.70 (02 Nov 1988)
300.Modules.BASIC64 1.05 (12 Mar 1992)
300.Modules.SCSIFiler 1.10 (16 Jan 1992)
300.Modules.SerialUtil 0.02 (11 Feb 1992)
310.Modules.Colours 1.57 (06 Dec 1993)
350.Modules.ABCLib 4.02 (14 Feb 1992)
350.Modules.ABIMod 2.86 (18 Jan 1994)
350.Modules.BASIC64 1.06 (23 Aug 1993)
350.Modules.DDEUtils 1.52 (09 Jan 1992)
350.Modules.DDT 1.62 (06 Jan 1994)
350.Modules.FrontEnd 1.14 (27 Nov 1992)
| !Run file for !System, version 0.76 (24-Apr-97)
|
IconSprites <Obey$Dir>.!Sprites
WimpSlot 12k 12k
Set System$Dir <Obey$Dir>
/<Obey$Dir>.SysPaths
IconSprites <Obey$Dir>.!Sprites
If "<System$Dir>" = "" Then Set System$Dir <Obey$Dir>
If "<System$Path>" = "" Then /<Obey$Dir>.SysPaths
IconSprites <Obey$Dir>.!Sprites
If "<System$Dir>" = "" Then Set System$Dir <Obey$Dir>
If "<System$Path>" = "" Then /<Obey$Dir>.SysPaths
The System application
=== ====== ===========
The !System directory contains relocatable modules
shared by various Applications Suite programs, held
in the directory !System.Modules. You will not need
to take any special action to load these modules:
they will be loaded as required by applications,
provided a directory display containing !System has
been opened at some stage.
Error messages
==============
If the error message "Filing system or path
'System:' not present" appears when you are using an
Applications Suite program, you should open a
directory display containing !System and then try
the operation again.
If an error message of the form "You need some
module x.xx or later" appears when you try to run an
application then the directory !System.Modules does
not contain a sufficiently up-to-date version of the
relocatable module "some-module".
/* Copyright 1996 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*main.c - generate system variables for System application*/
/*From CLib*/
#include <stdio.h>
#include <string.h>
/*From OSLib*/
#include "macros.h"
#include "os.h"
#include "osgbpb.h"
#include "osmodule.h"
/*From Support*/
#include "x.h"
/* J R C 2nd Mar 1995 Sorts the path elements, rather than assuming they
come out in numerical order.
Use x-clear SWI's.
Match any numerical directory. Sort in numerical
order.
*/
#define ENTRY_LIMIT 32 /*Number path elements we can cope with.*/
x_STATIC_ERROR (Too_Many_Entries, 1, "Too many entries")
static int Compare (void const *i0, void const *i1)
{return atoi (*(char **) i1) - atoi (*(char **) i0);}
/*
* Return the version number of a ROM module.
*/
static int Module_Version(const char *module)
{
int v = 0, m, s;
char *name;
x_exception x;
m = 0, s = -1;
x_TRY (&x)
/*Bizarrely, this call only stops when it gets an error ...*/
while (TRUE)
{ m = osmodule_enumerate_rom_with_info (m, s, &s, &name, NULL,
NULL, &v);
if (strcmp (name, module) == 0)
break;
}
x_CATCH (&x)
;
return v >> 8;
}
int main (void)
{ char info [os_FILE_NAME_LIMIT + 1], system_path [1024 + 1],
system_dir [1024 + 1], sys_path [os_CLI_LIMIT + 1],
os_version [os_CLI_LIMIT + 1], *entries [ENTRY_LIMIT];
int context, version, n, used, v, entry, entry_count;
char *point;
x_exception x;
os_error *e;
x_TRY (&x)
{ /*Fix fault: ignore arguments, and read System$Dir instead. J R C
20th Mar 1995*/
os_read_var_val ("System$Dir", system_dir, sizeof system_dir, 0,
os_VARTYPE_STRING, &used, NULL);
system_dir [used] = '\0';
/*Set Sys$Path*/
sprintf (sys_path, "%s.", system_dir);
os_set_var_val ("Sys$Path", (byte *) sys_path, strlen (sys_path), 0,
os_VARTYPE_STRING, NULL);
/*Which OS are we running under?*/
e = xos_read_var_val ("Boot$OSVersion", os_version, sizeof os_version, 0,
os_VARTYPE_STRING, &used, NULL, NULL);
if (e->errnum == error_VAR_CANT_FIND)
{
/* Set it if not already set */
sprintf(os_version, "%X0%n", Module_Version("UtilityModule")/16, &used);
os_set_var_val("Boot$OSVersion", (byte *) os_version, used, 0,
os_VARTYPE_STRING, NULL);
}
else if (e)
x_THROW(e);
else
os_version [used] = '\0';
/* Turn "3.50" into "350" */
if ((point = strchr(os_version, '.')) != NULL)
{
do
{
*point=*(point+1);
}
while (*++point);
os_set_var_val("Boot$OSVersion", (byte *) os_version, used, 0,
os_VARTYPE_STRING, NULL);
}
sscanf (os_version, "%d%n", &version, (n = -1, &n));
if (n == strlen (os_version))
{ entry_count = 0;
context = 0;
while ((context = osgbpb_dir_entries (system_dir,
(osgbpb_string_list *) info, 1, context, sizeof info, "*",
NULL)) != osgbpb_NO_MORE)
{ /*Check that the name is composed of digits.*/
sscanf (info, "%d%n", &v, (n = -1, &n));
if (n == strlen (info) && v <= version)
{ /*Add this directory to our table.*/
if (entry_count == ENTRY_LIMIT)
x_THROW (Too_Many_Entries);
strcpy (entries [entry_count++] = x_alloc (strlen (info) + 1),
info);
}
}
/*Sort the list we just made.*/
qsort (entries, entry_count, sizeof *entries, &Compare);
CLEAR (system_path);
for (entry = 0; entry < entry_count; entry++)
{ if (!EMPTY (system_path)) strcat (system_path, ",");
sprintf (system_path + strlen (system_path), "Sys:%s.",
entries [entry]);
}
if (!EMPTY (system_path)) strcat (system_path, ",");
strcat (system_path, sys_path);
os_set_var_val ("System$Path", (byte *) system_path,
strlen (system_path), 0, os_VARTYPE_STRING, NULL);
}
}
x_CATCH (&x)
;
x_EXIT (&x);
}
File added
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