Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions core/alsp_src/builtins/blt_shl.pro
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ ss_load_the_dot_alspro(AutoFile, Verbosity)
print_banner(OutS,L)
:-
system_name(L, Name),
dmember(os_variation = OSVar, L),
dmember(sysname = Sysname, L),
dmember(machine = Machine, L),
dmember(prologVersion = Version, L),
dmember(prologYear = Year, L),
current_prolog_flag(windows_system, WinsName),
Expand All @@ -312,9 +313,9 @@ print_banner(OutS,L)
name(WBan, [UInC | WNCs]),
!,
#if (all_procedures(syscfg,intconstr,0,_))
printf(OutS,'CLP(BNR)(r) \[%s Version %s \[%s\]\]\n',[Name,Version,OSVar]),
printf(OutS,'CLP(BNR)(r) \[%s Version %s \[%s/%s\]\]\n',[Name,Version,Sysname,Machine]),
#else
printf(OutS,'%s Version %s \[%s\]\n',[Name,Version,OSVar]),
printf(OutS,'%s Version %s \[%s/%s\]\n',[Name,Version,Sysname,Machine]),
#endif
printf(OutS,' Copyright (c) 1987-%s Applied Logic Systems, Inc.\n\n',[Year]),
flush_output(OutS).
Expand Down
4 changes: 3 additions & 1 deletion core/alsp_src/builtins/builtins.pro
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ use debugger.
| processor i8086, i286, i386, i486
| m68k, m88k, vax, ...
| portable
| manufacturer (.e.g. sun3).....
| sysname (e.g. SunOS)...
| release -- 'nn.mm' --
| machine (e.g. Sparc)...
| prolog_version -- 'nnn.mm' ---
|
|
Expand Down
3 changes: 0 additions & 3 deletions core/alsp_src/generic/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
| script instead, and configure appropriately inside the sources.
*---------------------------------------------------------------------*/

/* #define SysName "ALS Prolog" -- now computed in blt_shl.pro */
#define SysManufacturer "generic"

/* Like UNIX and OSStr above, assume that the OS has a brk() call. */

#ifdef MacOS
Expand Down
30 changes: 23 additions & 7 deletions core/alsp_src/generic/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#include <sys/utsname.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
Expand Down Expand Up @@ -129,8 +130,8 @@ static void panic_continue ( void );
static void abolish_predicate ( const char *, const char *, int );
static void assert_sys_searchdir ( char * );
static void assert_als_system (const char *, const char *,
const char *, const char *,
const char *, const char *, int);
const char *, const char *, const char *,
const char *, const char *, const char *, int);
static void assert_atom_in_module ( const char*, const char * );


Expand Down Expand Up @@ -426,19 +427,34 @@ static int PI_prolog_init0(const PI_system_setup *setup)
/*---------------------------------------*
| Set up the als_system fact.
*---------------------------------------*/


const char *System = "sys", *Machine = "arch", *Release = "";

#ifdef UNIX

struct utsname name;
uname(&name);
System = name.sysname;
Machine = name.machine;
Release = name.release;

#endif

#ifdef MSWin32


if (IS_NT) MinorOSStr = "mswinnt";
else if (IS_WIN32S) MinorOSStr = "mswin32s";
else if (IS_WIN95) MinorOSStr = "mswin95";

System = OSStr;
Machine = MinorOSStr;

#endif

#ifndef KERNAL
assert_als_system(OSStr, MinorOSStr, ProcStr,
SysManufacturer, versionNum, versionYear, heapWordBytes);
System, Release, Machine, versionNum, versionYear, heapWordBytes);

/*-------------------------------------------*
| Set up conditional configuration controls:
Expand Down Expand Up @@ -618,19 +634,19 @@ assert_atom_in_module(const char *mod_name, const char *atom_name)
*-----------------------------------------------------------------------------*/
static void
assert_als_system(const char *os, const char *os_var, const char *proc,
const char *man, const char *ver, const char *year, int hwb)
const char *sys, const char *rel, const char *mach, const char *ver, const char *year, int hwb)
{
char command[2048];

if (noautoload && !pckgloaded)
return;

sprintf(command,
"assertz(builtins,als_system([os='%s',os_variation='%s',processor='%s',manufacturer='%s',prologVersion='%s',prologYear='%s',heapWordBytes=%d]),_,0)",
"assertz(builtins,als_system([os='%s',os_variation='%s',processor='%s',sysname='%s',release='%s',machine='%s',prologVersion='%s',prologYear='%s',heapWordBytes=%d]),_,0)",
os,
os_var,
proc,
man,
sys, rel, mach,
ver,
year,
heapWordBytes);
Expand Down
6 changes: 4 additions & 2 deletions docs/docs/ref/als_system.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ Each property appears at most once. The properties and their possible values are
| os | unix, dos, macos, mswins32, vms |
| os_variation |(unix) : solaris2.4 |
| processor | port_thread, port_byte, i386, m68k, m88k, sparc, powerpc |
| manufacturer | generic, sun, motorola, dec, |
| sysname | SunOS, Linux, Darwin, ... |
| release | OS release version |
| machine | sparc, i368, arm64, ... |
| prologVersion | `nnn-mm` |
| wins | nowins, motif, macos, ... |

Expand All @@ -59,5 +61,5 @@ On a Sun SPARC running Solaris 2.4, TTY portable version :
?- als_system(X).

X = [os = unix, os_variation = solaris2.4, processor = port_thread,
manufacturer = generic, prologVersion = '1-76 ', wins = nowins ]
sysname = 'SunOS', release = '2.4', machine = sparc, prologVersion = '1-76', wins = nowins ]
```
Loading