Home /Modules/os-level-support/SLOsSupportLinuxSource.sleela

SLOsSupportLinuxSource.sleela

lib/os-level-support/SLOsSupportLinuxSource.sleela · 105 line(s) · sleela

<< SLeeLa Standard Library Definition.
  Definition: Linux source-level facade. Portable calls use the existing OP_OS_*
  VM bridge; Linux-only interfaces are capability-gated native extensions.
  Procfs/sysfs, netlink, epoll, inotify and cgroups are never assumed present. >>
#sleela 2.5
material;

class SLOsSupportLinuxSource {
  < ---- Descriptive metadata (version 1.11 nested-friendly accessors) ---- >
  << Eleven catalogued attributes with getter/setter pairs, so a GUI, loader,
     or catalog can read and (where appropriate) override each record.
     Values are faithful to the subject's real origin where publicly known. >>
  String metaVersion = "1.0.0";
  int metaId = 0;
  String metaAuthor = "mearvk";
  String metaDate = "2026-11-05";
  String metaCopyright = "Copyright mearvk LLC";
  String metaTrademark = "none";
  String metaCorporation = "mearvk LLC";
  < metaOrigin: National | <nation> | International | Galactic >
  String metaOrigin = "International";
  String metaBirthDate = "2026-11-05";
  < metaScienceRating: maturity/robustness on a 1..10 scale >
  int metaScienceRating = 8;
  < metaNationalSchedule: a real, citable instrument or "none" >
  String metaNationalSchedule = "none";

  String getMetaVersion() { return metaVersion; }
  void setMetaVersion(String value) { metaVersion = value; }
  int getMetaId() { return metaId; }
  void setMetaId(int value) { metaId = value; }
  String getMetaAuthor() { return metaAuthor; }
  void setMetaAuthor(String value) { metaAuthor = value; }
  String getMetaDate() { return metaDate; }
  void setMetaDate(String value) { metaDate = value; }
  String getMetaCopyright() { return metaCopyright; }
  void setMetaCopyright(String value) { metaCopyright = value; }
  String getMetaTrademark() { return metaTrademark; }
  void setMetaTrademark(String value) { metaTrademark = value; }
  String getMetaCorporation() { return metaCorporation; }
  void setMetaCorporation(String value) { metaCorporation = value; }
  String getMetaOrigin() { return metaOrigin; }
  void setMetaOrigin(String value) { metaOrigin = value; }
  String getMetaBirthDate() { return metaBirthDate; }
  void setMetaBirthDate(String value) { metaBirthDate = value; }
  int getMetaScienceRating() { return metaScienceRating; }
  void setMetaScienceRating(int value) { metaScienceRating = value; }
  String getMetaNationalSchedule() { return metaNationalSchedule; }
  void setMetaNationalSchedule(String value) { metaNationalSchedule = value; }
  String backendTerm = "LinuxBackend";
  String platformName = "Linux";
  String pathSeparator = "/";
  String lineEnding = "\n";
  String executableSuffix = "";

  String getBackendTerm() { return backendTerm; }
  String getPlatformName() { return platformName; }
  String getPathSeparator() { return pathSeparator; }
  String getLineEnding() { return lineEnding; }
  String getExecutableSuffix() { return executableSuffix; }
  boolean isCurrentPlatform() { return osPlatform() == "Linux"; }

  < Portable operations: routed through the existing VM bridge. >
  String hostName() { return osHostName(); }
  String userName() { return osUserName(); }
  String currentDirectory() { return osCurrentDir(); }
  String temporaryDirectory() { return osTempDir(); }
  String environmentValue(String key) { return osGetEnv(key); }
  boolean setEnvironmentValue(String key, String value) { return osSetEnv(key, value) == 0; }
  boolean pathExists(String path) { return osExists(path) == 1; }
  boolean isDirectory(String path) { return osIsDir(path) == 1; }
  int fileSize(String path) { return osFileSize(path); }

<< Linux extension names are metadata only until a registered native binding
   is present. This prevents a catalogue entry from being mistaken for a call.
   The grouping terms are owned by the backend catalogue (SLOsSupportLinux);
   this facade delegates to that single source of truth rather than
   re-declaring the list. >>
  SLList getExtensionGroups() {
    SLOsSupportLinux backend = new SLOsSupportLinux();
    return backend.getGroupTerms();
  }

  SLList getNativeExtensionSymbols() {
    SLList out = new SLList();
    out.add("epoll_create1");
    out.add("epoll_ctl");
    out.add("epoll_wait");
    out.add("inotify_add_watch");
    out.add("inotify_init1");
    out.add("inotify_rm_watch");
    out.add("ioctl");
    out.add("netlink-NETLINK_ROUTE");
    out.add("procfs");
    out.add("sysfs");
    out.add("systemd-DBus");
    return out;
  }

  boolean nativeExtensionRegistered(String symbol) { return false; }
  String procfsRoot() { return "/proc"; }
  String sysfsRoot() { return "/sys"; }
  String deviceRoot() { return "/dev"; }
}