ChrisOS Research ProjectOperating systems · language systems · graphics · machine emulation
DOCUMENTATION ARCHIVEMAIN BRANCH
ChrisOS/Source reference: SRC/CAT.CC

Source reference: SRC/CAT.CC

Deterministic source record. The complete textual file is reproduced below; this page does not replace architectural interpretation in the authored chapters.

File identity

Field Value
Path SRC/CAT.CC
Lines 46
Bytes 655
SHA-256 47c39e202a48af5d1a58f3305f8126a2233336d5351d6c714866b33302736f68
ChrisOS revision da3df29cb397932c43d32373871fb9380e688ade

Detected syntactic dependencies

Line Include
1 LIB/STR.H
2 LIB/STR.CC

Detected symbols

Line Symbol
4 main

Complete source

The following block is the complete textual file at the recorded revision. No lines are elided, abbreviated or paraphrased.

#include "LIB/STR.H"
#include "LIB/STR.CC"

void main() {
  char buf[128];
  int fd;
  int n;
  int i;
  int c;
  int len;
  viewport(320, 200);
  fd = fopen("SRC/HELLO.TXT");
  if (fd < 0) {
    clear(4);
    while (1) {
      if (key(1)) {
        return;
      }
      wait(1);
    }
  }
  n = fread(fd, buf, 127);
  fclose(fd);
  if (n < 0) {
    n = 0;
  }
  if (n > 127) {
    n = 127;
  }
  storeb(buf + n, 0);
  len = strlen(buf);
  while (1) {
    if (key(1)) {
      return;
    }
    clear(1);
    i = 0;
    while (i < len) {
      c = loadb(buf + i);
      rect(8 + i * 2, 70, 2, 10 + (c % 16), 14);
      i = i + 1;
    }
    wait(1);
  }
}

Role of this record

The atlas guarantees file-by-file traceability. Responsibility, invariants, ownership, concurrency, security, performance and subsystem interactions belong in authored chapters and must cite this file when applicable.

Document record ID: source-47c39e202a48af5d Reviewed source: da3df29cb397 Class: generated-source-reference