SLBallumStatus.sleela
lib/ballum/SLBallumStatus.sleela · 88 line(s) · sleela
<< lib/ballum/SLBallumStatus.sleela
SLeeLa Standard Library Definition.
Definition: Ballum result/status codes, mirroring ballum_status_t. >>
#sleela 2.5
material;
< Family: ballum. The result codes for every Ballum operation, mirroring the >
< native ballum_status_t enum in ballum/include/sleela_ballum/ballum_manager.h >
< one-for-one, plus the SLeeLa-side BRIDGE_REQUIRED code used before the VM >
< installs the native bridge. SLeeLa never fakes a successful display write: a >
< control that the backend or display cannot do returns UNSUPPORTED, and an >
< out-of-range pixel returns OUT_OF_BOUNDS, never a silent success. >
class SLBallumStatus {
< ---- 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 this record.
Values are faithful to the subject's real origin where publicly known. >>
String metaVersion = "1.0.0";
int metaId = 11539;
String metaAuthor = "Kiro Agent";
String metaDate = "2026-10-23";
String metaCopyright = "SLeeLa project";
String metaTrademark = "none";
String metaCorporation = "none";
< metaOrigin: National | <nation> | International | Galactic >
String metaOrigin = "International";
String metaBirthDate = "2026-10-23";
< metaScienceRating: maturity/robustness on a 1..10 scale >
int metaScienceRating = 9;
< metaNationalSchedule: a real, citable instrument or "none" >
String metaNationalSchedule = "none";
String getMetaVersion() { return metaVersion; }
void setMetaVersion(String v) { metaVersion = v; }
int getMetaId() { return metaId; }
void setMetaId(int v) { metaId = v; }
String getAuthor() { return metaAuthor; }
void setAuthor(String v) { metaAuthor = v; }
String getDate() { return metaDate; }
void setDate(String v) { metaDate = v; }
String getCopyright() { return metaCopyright; }
void setCopyright(String v) { metaCopyright = v; }
String getTrademark() { return metaTrademark; }
void setTrademark(String v) { metaTrademark = v; }
String getCorporation() { return metaCorporation; }
void setCorporation(String v) { metaCorporation = v; }
String getOrigin() { return metaOrigin; }
void setOrigin(String v) { metaOrigin = v; }
String getBirthDate() { return metaBirthDate; }
void setBirthDate(String v) { metaBirthDate = v; }
int getScienceRating() { return metaScienceRating; }
void setScienceRating(int v) { metaScienceRating = v; }
String getNationalSchedule() { return metaNationalSchedule; }
void setNationalSchedule(String v) { metaNationalSchedule = v; }
< --- native ballum_status_t (same ordinals) --- >
static final int OK = 0;
static final int INVALID_ARGUMENT = 1;
static final int BACKEND_UNAVAILABLE = 2;
static final int BACKEND_ERROR = 3;
static final int DISPLAY_NOT_FOUND = 4;
static final int OUT_OF_BOUNDS = 5;
static final int BUFFER_TOO_SMALL = 6;
static final int UNSUPPORTED = 7;
static final int PERMISSION_DENIED = 8;
static final int NOT_INITIALIZED = 9;
< --- SLeeLa bridge-boundary code (no native equivalent) --- >
< Returned before a host SLVM binding connects this facade to the native >
< ballum_manager_* API. >
static final int BRIDGE_REQUIRED = 100;
String text(int code) {
if (code == OK) { return "ok"; }
if (code == INVALID_ARGUMENT) { return "invalid argument"; }
if (code == BACKEND_UNAVAILABLE) { return "backend unavailable"; }
if (code == BACKEND_ERROR) { return "backend error"; }
if (code == DISPLAY_NOT_FOUND) { return "display not found"; }
if (code == OUT_OF_BOUNDS) { return "coordinate out of bounds"; }
if (code == BUFFER_TOO_SMALL) { return "buffer too small"; }
if (code == UNSUPPORTED) { return "unsupported by backend"; }
if (code == PERMISSION_DENIED) { return "permission denied"; }
if (code == NOT_INITIALIZED) { return "not initialized"; }
if (code == BRIDGE_REQUIRED) { return "native bridge required"; }
return "unknown";
}
boolean ok(int code) { return code == OK; }
}